jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329531 )

Change subject: Decoding null to null is not an error
......................................................................


Decoding null to null is not an error

Quit throwing exceptions when the queue is empty.

Change-Id: Ie5479c81c0a6138e1cad416b40d3edabffb1e9c4
---
M src/PHPQueue/Json.php
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Cdentinger: Looks good to me, approved
  jenkins-bot: Verified
  AndyRussG: Looks good to me, but someone else must approve



diff --git a/src/PHPQueue/Json.php b/src/PHPQueue/Json.php
index ad518ed..ed2e6d1 100644
--- a/src/PHPQueue/Json.php
+++ b/src/PHPQueue/Json.php
@@ -5,6 +5,9 @@
 
 class Json {
     public static function safe_decode( $text ) {
+        if ( $text === null ) {
+            return null;
+        }
         $data = json_decode($text, true);
         if ( $data === null ) {
             throw new JsonException("JSON could not be decoded: '{$text}'");

-- 
To view, visit https://gerrit.wikimedia.org/r/329531
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie5479c81c0a6138e1cad416b40d3edabffb1e9c4
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/php-queue
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: AndyRussG <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to