Skip to content

Commit 14a6fd9

Browse files
authored
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.
1 parent 9b1b7f6 commit 14a6fd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ private void setSystemChromeSystemUIOverlayStyle(
310310
}
311311

312312
private void popSystemNavigator() {
313-
if (platformPluginDelegate.popSystemNavigator()) {
313+
if (platformPluginDelegate != null && platformPluginDelegate.popSystemNavigator()) {
314314
// A custom behavior was executed by the delegate. Don't execute default behavior.
315315
return;
316316
}

0 commit comments

Comments
 (0)