Index: third_party/WebKit/Source/modules/nfc/NFC.cpp |
diff --git a/third_party/WebKit/Source/modules/nfc/NFC.cpp b/third_party/WebKit/Source/modules/nfc/NFC.cpp |
index 9f9649bae2dae0b3946495aa905e3ad8402d08e4..a8e470f1096f4ea3cd4a30c2d5821a160c7de889 100644 |
--- a/third_party/WebKit/Source/modules/nfc/NFC.cpp |
+++ b/third_party/WebKit/Source/modules/nfc/NFC.cpp |
@@ -17,6 +17,7 @@ |
#include "modules/nfc/NFCPushOptions.h" |
#include "platform/mojo/MojoHelper.h" |
#include "public/platform/InterfaceProvider.h" |
+#include "public/platform/Platform.h" |
namespace mojom = device::nfc::mojom::blink; |
@@ -561,6 +562,11 @@ void NFC::OnRequestCompleted(ScriptPromiseResolver* resolver, |
} |
void NFC::OnConnectionError() { |
+ if (!Platform::current()) { |
+ // TODO(rockot): Clean this up once renderer shutdown sequence is fixed. |
+ return; |
+ } |
+ |
m_nfc.reset(); |
// If NFCService is not available or disappears when NFC hardware is |