Skip to content

Commit 55207e1

Browse files
authored
codeLength input validation
1 parent f0a9a83 commit 55207e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dart/lib/src/open_location_code.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ bool isFull(String code) {
220220
/// including any separator characters.
221221
String encode(num latitude, num longitude, {int codeLength: pairCodeLength}) {
222222
if (codeLength < 2 ||
223-
(codeLength < separatorPosition && codeLength % 2 == 1)) {
223+
(codeLength < pairCodeLength && codeLength % 2 == 1)) {
224224
throw new ArgumentError('Invalid Open Location Code length: $codeLength');
225225
}
226226
// Ensure that latitude and longitude are valid.

0 commit comments

Comments
 (0)