From 14a6fd97ca12674d4c8668c3e8aa5196f62b9e45 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 (#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/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java index 5dba56b4f..2140ce39f 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 @@ 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; } -- GitLab