Index: ios/chrome/browser/infobars/infobar_container_ios.mm |
diff --git a/ios/chrome/browser/infobars/infobar_container_ios.mm b/ios/chrome/browser/infobars/infobar_container_ios.mm |
index bd1223b3784b882b6b0b16165258afddd5027418..2919449b6e254c72f296c0731fd7d8b28fde020b 100644 |
--- a/ios/chrome/browser/infobars/infobar_container_ios.mm |
+++ b/ios/chrome/browser/infobars/infobar_container_ios.mm |
@@ -22,6 +22,7 @@ InfoBarContainerIOS::InfoBarContainerIOS( |
} |
InfoBarContainerIOS::~InfoBarContainerIOS() { |
+ delegate_ = nullptr; |
RemoveAllInfoBarsForDestruction(); |
} |
@@ -44,7 +45,7 @@ void InfoBarContainerIOS::PlatformSpecificRemoveInfoBar( |
// Otherwise, the infobar is being replaced by another one. Do not call the |
// delegate in this case, as the delegate will be updated when the new infobar |
// is added. |
- if (infobar->total_height() == 0) |
+ if (infobar->total_height() == 0 && delegate_) |
delegate_->InfoBarContainerStateChanged(false); |
// TODO(rohitrao, jif): [Merge 239355] Upstream InfoBarContainer deletes the |