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.
This commit is contained in:
Chris Bracken
2020-12-03 15:22:34 -08:00
committed by GitHub
parent 22c07bc178
commit d7804003d4

View File

@@ -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;
}