You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you make a distance matrix call that returns any NOT_FOUND cells, which happens if you give an address that is both incomplete and invalid (eg. "1 Nonexistant Street" with no city), distance.dart throws The method '[]' was called on null. because it tries to dereference JSON keys that don't exist.
Here's the stacktrace:
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
#1 _$ValueFromJson (package:google_maps_webservice/src/distance.g.dart:66:16)
#2 new Value.fromJson (package:google_maps_webservice/src/distance.dart:328:56)
#3 _$ElementFromJson (package:google_maps_webservice/src/distance.g.dart:52:21)
#4 new Element.fromJson (package:google_maps_webservice/src/distance.dart:317:7)
#5 _$RowFromJson.<anonymous closure> (package:google_maps_webservice/src/distance.g.dart:40:34)
#6 MappedListIterable.elementAt (dart:_internal/iterable.dart:412:31)
#7 ListIterator.moveNext (dart:_internal/iterable.dart:341:26)
#8 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:188:27)
#9 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#10 new List.of (dart:core-patch/array_patch.dart:50:28)
#11 ListIterable.toList (dart:_internal/iterable.dart:212:44)
#12 _$RowFromJson (package:google_maps_webservice/src/distance.g.dart:41:14)
#13 new Row.fromJson (package:google_maps_webservice/src/distance.dart:300:54)
#14 _$DistanceResponseFromJson.<anonymous closure> (package:google_maps_webservice/src/distance.g.dart:22:30)
#15 MappedListIterable.elementAt (dart:_internal/iterable.dart:412:31)
#16 ListIterator.moveNext (dart:_internal/iterable.dart:341:26)
#17 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:188:27)
#18 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#19 new List.of (dart:core-patch/array_patch.dart:50:28)
#20 ListIterable.toList (dart:_internal/iterable.dart:212:44)
#21 _$DistanceResponseFromJson (package:google_maps_webservice/src/distance.g.dart:23:14)
#22 new DistanceResponse.fromJson (package:google_maps_webservice/src/distance.dart:289:7)
#23 GoogleDistanceMatrix._decode (package:google_maps_webservice/src/distance.dart:254:24)
#24 GoogleDistanceMatrix._distance (package:google_maps_webservice/src/distance.dart:60:12)
<asynchronous suspension>
#25 StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart)
<asynchronous suspension>
And here's an example maps API response showing the NOT_FOUND elements:
If you make a distance matrix call that returns any NOT_FOUND cells, which happens if you give an address that is both incomplete and invalid (eg. "1 Nonexistant Street" with no city), distance.dart throws
The method '[]' was called on null.
because it tries to dereference JSON keys that don't exist.Here's the stacktrace:
And here's an example maps API response showing the NOT_FOUND elements:
The text was updated successfully, but these errors were encountered: