Skip to content

AutocompletePrediction.fromJson throws NoSuchMethodError: The method 'map' was called on null. #47

@stx

Description

@stx

Rare error seen on iOS production app when calling place.autocomplete.get(...):

NoSuchMethodError: NoSuchMethodError: The method 'map' was called on null.
Receiver: null
Tried calling: map<MainTextMatchedSubstring>(Closure: (dynamic) => MainTextMatchedSubstring)
  File "object_patch.dart", line 38, in Object.noSuchMethod
  File "object_patch.dart", line 85, in _objectNoSuchMethod
  File "structured_formatting.dart", line 22, in new StructuredFormatting.fromJson
  File "autocomplete_prediction.dart", line 65, in new AutocompletePrediction.fromJson
  File "autocomplete_response.dart", line 18, in new AutocompleteResponse.fromJson.<fn>
  File "iterable.dart", line 413, in MappedListIterable.elementAt
  File "iterable.dart", line 342, in ListIterator.moveNext
  File "growable_array.dart", line 206, in new _GrowableList._ofEfficientLengthIterable
  File "growable_array.dart", line 153, in new _GrowableList.of
  File "array_patch.dart", line 51, in new List.of
  File "set.dart", line 118, in SetMixin.toList
  File "autocomplete_response.dart", line 19, in new AutocompleteResponse.fromJson
  File "autocomplete_response.dart", line 26, in AutocompleteResponse.parseAutocompleteResult
  File "autocomplete.dart", line 110, in Autocomplete.get

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions