Skip to content

Commit 7a921b0

Browse files
authored
code length validation
1 parent 53380e1 commit 7a921b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/closure/openlocationcode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ function encode(latitude, longitude, opt_length) {
264264
opt_length = PAIR_CODE_LENGTH;
265265
}
266266
if (opt_length < 2 ||
267-
(opt_length < SEPARATOR_POSITION && opt_length % 2 == 1)) {
267+
(opt_length < PAIR_CODE_LENGTH && opt_length % 2 == 1)) {
268268
throw 'IllegalArgumentException: Invalid Open Location Code length';
269269
}
270270
// Ensure that latitude and longitude are valid.

0 commit comments

Comments
 (0)