diff --git a/packages/amplify_datastore_plugin_interface/lib/src/types/utils/parsers.dart b/packages/amplify_datastore_plugin_interface/lib/src/types/utils/parsers.dart index ca5bf684e7..013fc31faa 100644 --- a/packages/amplify_datastore_plugin_interface/lib/src/types/utils/parsers.dart +++ b/packages/amplify_datastore_plugin_interface/lib/src/types/utils/parsers.dart @@ -23,4 +23,4 @@ String? enumToString(Object? o) => // only to be used internally by amplify-flutter library T? enumFromString(String? key, List values) => - values.firstWhereOrNull((v) => key == enumToString(v)); + key == null ? null : values.firstWhereOrNull((v) => key == enumToString(v));