Index: third_party/WebKit/Source/modules/payments/PaymentAppRequestConversion.cpp |
diff --git a/third_party/WebKit/Source/modules/payments/PaymentAppRequestConversion.cpp b/third_party/WebKit/Source/modules/payments/PaymentAppRequestConversion.cpp |
index abe0dd5bfc87237d34009d5a6fb62a45ba1a9ac0..864bae6fec843fb85d69d712c54d70f9c02f85d4 100644 |
--- a/third_party/WebKit/Source/modules/payments/PaymentAppRequestConversion.cpp |
+++ b/third_party/WebKit/Source/modules/payments/PaymentAppRequestConversion.cpp |
@@ -86,7 +86,13 @@ PaymentMethodData toPaymentMethodData( |
PaymentAppRequest PaymentAppRequestConversion::toPaymentAppRequest( |
ScriptState* scriptState, |
const WebPaymentAppRequest& webAppRequest) { |
+ DCHECK(scriptState); |
+ |
PaymentAppRequest appRequest; |
+ if (!scriptState->contextIsValid()) |
+ return appRequest; |
+ |
+ ScriptState::Scope scope(scriptState); |
appRequest.setOrigin(webAppRequest.origin); |
HeapVector<PaymentMethodData> methodData; |