Commit a46bc2c8 authored by Liquan (Max) Gu's avatar Liquan (Max) Gu Committed by Commit Bot

Null-check navigationController before using

Context:
WebContents#getNavigationController() can return null.
PaymentHandlerMediator should null-check the getter's return before
using it.

Bug: 1137695

Change-Id: I9a78ebfd60666268ef48566e0d7437a59e198a3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463713Reviewed-by: default avatarNick Burris <nburris@chromium.org>
Reviewed-by: default avatarSahel Sharify <sahel@chromium.org>
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820034}
parent 44c7f368
......@@ -286,6 +286,6 @@ import java.lang.annotation.RetentionPolicy;
private void onSystemBackButtonClicked() {
NavigationController navigation = mPaymentHandlerWebContents.getNavigationController();
if (navigation.canGoBack()) navigation.goBack();
if (navigation != null && navigation.canGoBack()) navigation.goBack();
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment