Ejegg has uploaded a new change for review. ( 
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(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/php-queue 
refs/changes/31/329531/1

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: newchange
Gerrit-Change-Id: Ie5479c81c0a6138e1cad416b40d3edabffb1e9c4
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/php-queue
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>

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

Reply via email to