From a46510598e31c2cc3b2701c383c3085f08cd69ce Mon Sep 17 00:00:00 2001 From: Gary Qian Date: Fri, 19 Oct 2018 14:18:09 -0700 Subject: [PATCH] Null check in locale resolution (#23301) --- packages/flutter/lib/src/widgets/app.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/flutter/lib/src/widgets/app.dart b/packages/flutter/lib/src/widgets/app.dart index a6db3e347d..15c9de9ed5 100644 --- a/packages/flutter/lib/src/widgets/app.dart +++ b/packages/flutter/lib/src/widgets/app.dart @@ -678,6 +678,9 @@ class _WidgetsAppState extends State implements WidgetsBindingObserv Locale _locale; Locale _resolveLocale(Locale newLocale, Iterable supportedLocales) { + if (newLocale == null) { + return supportedLocales.first; + } if (widget.localeResolutionCallback != null) { final Locale locale = widget.localeResolutionCallback(newLocale, widget.supportedLocales); if (locale != null)