From 3a802c7d897172308d11899cb38d4e66d0102101 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 24 Apr 2020 16:34:52 +0800 Subject: [PATCH] commit may not return an event --- MTrackWeb/Browse.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/MTrackWeb/Browse.php b/MTrackWeb/Browse.php index ac29c994..5ecbadfa 100644 --- a/MTrackWeb/Browse.php +++ b/MTrackWeb/Browse.php @@ -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); -- 2.39.2