commit may not return an event
authorAlan Knowles <alan@roojs.com>
Fri, 24 Apr 2020 08:34:52 +0000 (16:34 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 24 Apr 2020 08:34:52 +0000 (16:34 +0800)
MTrackWeb/Browse.php

index ac29c99..5ecbadf 100644 (file)
@@ -381,11 +381,13 @@ class MTrackWeb_Browse extends MTrackWeb
         foreach($revs as $hash => $sobject) {
             $event = $impl->commitLogToEvent($sobject);
             // add something??? 
-            if (isset($map[$hash]) && is_object($map[$hash])) {
-                $event->is_dir = $map[$hash]->is_dir;
-                $event->name = $map[$hash]->name;
-                $event->basename = $map[$hash]->basename;
+            if (!$event) {
+                continue;
             }
+            $event->is_dir = $map[$hash]->is_dir;
+            $event->name = $map[$hash]->name;
+            $event->basename = $map[$hash]->basename;
+        
             $map[$hash] =  $event; // this was previous only done for directories??? why???
         }
         return array_values($map);