Author: chabotc
Date: Mon Oct 13 10:44:05 2008
New Revision: 704180
URL: http://svn.apache.org/viewvc?rev=704180&view=rev
Log:
debug => false caused 'null' to be outputted on empty result sets (such as
delete & create activities, etc), so if response = null, don't output anything
Modified:
incubator/shindig/trunk/php/src/social/converters/OutputJsonConverter.php
Modified:
incubator/shindig/trunk/php/src/social/converters/OutputJsonConverter.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social/converters/OutputJsonConverter.php?rev=704180&r1=704179&r2=704180&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social/converters/OutputJsonConverter.php
(original)
+++ incubator/shindig/trunk/php/src/social/converters/OutputJsonConverter.php
Mon Oct 13 10:44:05 2008
@@ -31,10 +31,13 @@
if ($itemsPerPage > 0)
$response->itemsPerPage = $itemsPerPage;
}
- if (Config::get('debug')) {
- echo self::json_format(json_encode($response)); //
TODO: add a query option to pretty-print json output
- } else {
- echo json_encode($response);
+ // several service calls return a null value
+ if (!is_null($response)) {
+ if (Config::get('debug')) {
+ echo self::json_format(json_encode($response));
// TODO: add a query option to pretty-print json output
+ } else {
+ echo json_encode($response);
+ }
}
}