Skip to content

Commit dac82e8

Browse files
committed
catch missing owner exception in pi_search.php
1 parent d3bbdea commit dac82e8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

resources/lib/UnitySite.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static function errorLog(
3737
string $title,
3838
string $message,
3939
?string $errorid = null,
40-
?Throwable $error = null,
40+
?\Throwable $error = null,
4141
mixed $data = null,
4242
) {
4343
if (!CONFIG["site"]["enable_verbose_error_log"]) {
@@ -65,7 +65,7 @@ public static function errorLog(
6565
}
6666

6767
// recursive on $t->getPrevious()
68-
private static function throwableToArray(Throwable $t): array
68+
private static function throwableToArray(\Throwable $t): array
6969
{
7070
$output = [
7171
"type" => gettype($t),

webroot/panel/modal/pi_search.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424
break;
2525
}
2626
}
27-
$fn = strtolower($assoc_obj->getOwner()->getFullName());
27+
try {
28+
$fn = strtolower($assoc_obj->getOwner()->getFullName());
29+
} catch (Throwable $e) {
30+
UnitySite::errorLog("warning", "failed to get owner name for PI group '$assoc'", error: $e);
31+
$fn = "";
32+
}
2833
if (strpos($fn, strtolower($search_query)) !== false) {
2934
if (!in_array($assoc, $out)) {
3035
array_push($out, $assoc);

0 commit comments

Comments
 (0)