[ios] Do not show grey placeholders when there is no current tab.

This fixes a crash that occurs when trying to access UserData for a NULL
WebState.

BUG=812237
TEST=None, could not find repro steps.

Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I59f2063a20887870f0e70368cda72cf85281dfe4
Reviewed-on: https://chromium-review.googlesource.com/927281
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#538062}(cherry picked from commit aff0df6843211db6eea1caa9b2daf751367e04e0)
Reviewed-on: https://chromium-review.googlesource.com/935061
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/branch-heads/3325@{#571}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index d364312..5e14235 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -1071,7 +1071,7 @@
     Tab* currentTab = [_model currentTab];
     // Force loading the view in case it was not loaded yet.
     [self loadViewIfNeeded];
-    if (_expectingForegroundTab) {
+    if (currentTab && _expectingForegroundTab) {
       PagePlaceholderTabHelper::FromWebState(currentTab.webState)
           ->AddPlaceholderForNextNavigation();
     }