Title: [202342] trunk/Source/WebCore
Revision
202342
Author
[email protected]
Date
2016-06-22 12:10:00 -0700 (Wed, 22 Jun 2016)

Log Message

Exception is not thrown when shipping method is an invalid amount
https://bugs.webkit.org/show_bug.cgi?id=159030
rdar://problem/26700413

Reviewed by Tim Horton.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::createShippingMethods):
Bail if createShippingMethod returns Nullopt.

(WebCore::createPaymentRequest):
Bail if createShippingMethods returns Nullopt.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (202341 => 202342)


--- trunk/Source/WebCore/ChangeLog	2016-06-22 18:43:18 UTC (rev 202341)
+++ trunk/Source/WebCore/ChangeLog	2016-06-22 19:10:00 UTC (rev 202342)
@@ -1,6 +1,21 @@
 2016-06-22  Anders Carlsson  <[email protected]>
 
         Exception is not thrown when shipping method is an invalid amount
+        https://bugs.webkit.org/show_bug.cgi?id=159030
+        rdar://problem/26700413
+
+        Reviewed by Tim Horton.
+
+        * Modules/applepay/ApplePaySession.cpp:
+        (WebCore::createShippingMethods):
+        Bail if createShippingMethod returns Nullopt.
+
+        (WebCore::createPaymentRequest):
+        Bail if createShippingMethods returns Nullopt.
+
+2016-06-22  Anders Carlsson  <[email protected]>
+
+        Exception is not thrown when shipping method is an invalid amount
         https://bugs.webkit.org/show_bug.cgi?id=159029
         rdar://problem/26700413
 

Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (202341 => 202342)


--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2016-06-22 18:43:18 UTC (rev 202341)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp	2016-06-22 19:10:00 UTC (rev 202342)
@@ -448,6 +448,8 @@
 
         if (auto shippingMethod = createShippingMethod(window, shippingMethodDictionary))
             result.append(*shippingMethod);
+        else
+            return Nullopt;
     }
 
     return result;
@@ -564,8 +566,11 @@
     }
 
     if (auto shippingMethodsArray = dictionary.get<ArrayValue>("shippingMethods")) {
-        if (auto shippingMethods = createShippingMethods(window, *shippingMethodsArray))
-            paymentRequest.setShippingMethods(*shippingMethods);
+        auto shippingMethods = createShippingMethods(window, *shippingMethodsArray);
+        if (!shippingMethods)
+            return Nullopt;
+
+        paymentRequest.setShippingMethods(*shippingMethods);
     }
 
     if (auto totalDictionary = dictionary.get<Dictionary>("total")) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to