1diff --git base/message_loop/message_pump_mac.mm base/message_loop/message_pump_mac.mm 2index 36836673e97e5..96414c7bf97ee 100644 3--- base/message_loop/message_pump_mac.mm 4+++ base/message_loop/message_pump_mac.mm 5@@ -696,7 +696,8 @@ void MessagePumpUIApplication::Detach() { 6 #else 7 8 ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { 9- DCHECK(g_app_pump); 10+ if (!g_app_pump) 11+ return; 12 DCHECK_EQ(kNSApplicationModalSafeModeMask, g_app_pump->GetModeMask()); 13 // Pumping events in private runloop modes is known to interact badly with 14 // app modal windows like NSAlert. 15@@ -706,7 +707,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { 16 } 17 18 ScopedPumpMessagesInPrivateModes::~ScopedPumpMessagesInPrivateModes() { 19- DCHECK(g_app_pump); 20+ if (!g_app_pump) 21+ return; 22 g_app_pump->SetModeMask(kNSApplicationModalSafeModeMask); 23 } 24 25