Commit 09f4d3c1 authored by Lijin Shen's avatar Lijin Shen Committed by Chromium LUCI CQ

[Messages] Fix NPE when modal dialog manager supplier offers a null

When AsyncInitializationActivity is destroyed, modalDialogManagerSupplier
offers a null object, which cause the mediator a NPE.

Bug: 1169413, 1163300
Change-Id: I858ffc2aab2fcedabb792087780072808789f76e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2644064Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Theresa  <twellington@chromium.org>
Auto-Submit: Lijin Shen <lazzzis@google.com>
Cr-Commit-Position: refs/heads/master@{#846192}
parent 4b6a809f
...@@ -214,6 +214,7 @@ public class ChromeMessageQueueMediator implements MessageQueueDelegate { ...@@ -214,6 +214,7 @@ public class ChromeMessageQueueMediator implements MessageQueueDelegate {
} }
private void setTabModelSelector(TabModelSelector tabModelSelector) { private void setTabModelSelector(TabModelSelector tabModelSelector) {
if (tabModelSelector == null) return;
if (mTabModelSelector != null) { if (mTabModelSelector != null) {
mTabModelSelector.getTabModelFilterProvider().removeTabModelFilterObserver( mTabModelSelector.getTabModelFilterProvider().removeTabModelFilterObserver(
mTabModelObserver); mTabModelObserver);
...@@ -223,6 +224,7 @@ public class ChromeMessageQueueMediator implements MessageQueueDelegate { ...@@ -223,6 +224,7 @@ public class ChromeMessageQueueMediator implements MessageQueueDelegate {
} }
private void setModalDialogManager(ModalDialogManager modalDialogManager) { private void setModalDialogManager(ModalDialogManager modalDialogManager) {
if (modalDialogManager == null) return;
if (mModalDialogManager != null) { if (mModalDialogManager != null) {
mModalDialogManager.removeObserver(mModalDialogManagerObserver); mModalDialogManager.removeObserver(mModalDialogManagerObserver);
} }
......
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