From 7743445323dc28f2e5487007e00834a141ab0617 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 22 Mar 2021 21:30:56 -0400 Subject: [PATCH] Handle when there isn't a server Id --- web/ajax/log.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/ajax/log.php b/web/ajax/log.php index 4fed0088b..c5181e49b 100644 --- a/web/ajax/log.php +++ b/web/ajax/log.php @@ -169,7 +169,8 @@ function queryRequest() { foreach ( $results as $row ) { $row['DateTime'] = strftime('%Y-%m-%d %H:%M:%S', intval($row['TimeKey'])); $Server = ZM\Server::find_one(array('Id'=>$row['ServerId'])); - $row['Server'] = $Server->Name(); + + $row['Server'] = $Server ? $Server->Name() : ''; // First strip out any html tags // Second strip out all characters that are not ASCII 32-126 (yes, 126) $row['Message'] = preg_replace('/[^\x20-\x7E]/', '', strip_tags($row['Message']));