]> source.dussan.org Git - nextcloud-server.git/commitdiff
prevent PHP errors and enhance logging
authorThomas Müller <thomas.mueller@tmit.eu>
Fri, 1 Aug 2014 07:54:32 +0000 (09:54 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Fri, 1 Aug 2014 07:54:32 +0000 (09:54 +0200)
lib/private/ocsclient.php

index dc52fc27b5e027d4b7744efe6ead029702b26c57..e1db0995eab16b01b1c1232ac99c49982e3b8951 100644 (file)
@@ -162,7 +162,7 @@ class OC_OCSClient{
                $xml=OC_OCSClient::getOCSresponse($url);
 
                if($xml==false) {
-                       OC_Log::write('core', 'Unable to parse OCS content', OC_Log::FATAL);
+                       OC_Log::write('core', 'Unable to parse OCS content for app ' . $id, OC_Log::FATAL);
                        return null;
                }
                $loadEntities = libxml_disable_entity_loader(true);
@@ -170,6 +170,10 @@ class OC_OCSClient{
                libxml_disable_entity_loader($loadEntities);
 
                $tmp=$data->data->content;
+               if (is_null($tmp)) {
+                       OC_Log::write('core', 'Invalid OCS content returned for app ' . $id, OC_Log::FATAL);
+                       return null;
+               }
                $app=array();
                $app['id']=$tmp->id;
                $app['name']=$tmp->name;