From d7804003d4b90c1b1201b6712694a2ea938e5851 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 3 Dec 2020 15:22:34 -0800 Subject: [PATCH] Fix NPE when platform plugin delegate is null (flutter/engine#22852) 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/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java index 5dba56b4fc..2140ce39f7 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java @@ -310,7 +310,7 @@ public class PlatformPlugin { } 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; }