]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3098 catching exceptions when loading an object in system log
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 17 Mar 2011 11:07:22 +0000 (11:07 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 17 Mar 2011 11:07:22 +0000 (11:07 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8751 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/system_log.php

index 21e119b7c0f7aa2afa61fcd47e1559bd70455956..61b3863536b263f43b3c24da57726616736d32fb 100644 (file)
@@ -128,7 +128,12 @@ function get_object_from_log_entry($entry_id) {
 
        if ($entry) {
                $class = $entry->object_class;
-               $object = new $class($entry->object_id);
+               // surround with try/catch because object could be disabled
+               try {
+                       $object = new $class($entry->object_id);
+               } catch (Exception $e) {
+                       
+               }
                if ($object) {
                        return $object;
                }