From 80d2affb18a62507fc4241be6e61f216ee6444bb Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 3 Dec 2020 14:14:27 -0800 Subject: [PATCH] Fix NPE when platform plugin delegate is null Adds a null check before dereferencing in PlatformPlugin.popSystemNavigator. platformPluginDelegate is allowed to be null, as it is in the PlatformPlugin(Activity, PlatformChannel) constructor. --- .../android/io/flutter/plugin/platform/PlatformPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java index 5dba56b4fc920..2140ce39f7a78 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java @@ -310,7 +310,7 @@ private void setSystemChromeSystemUIOverlayStyle( } private void popSystemNavigator() { - if (platformPluginDelegate.popSystemNavigator()) { + if (platformPluginDelegate != null && platformPluginDelegate.popSystemNavigator()) { // A custom behavior was executed by the delegate. Don't execute default behavior. return; }