Skip to content

Commit 85e65b0

Browse files
authored
Don't pass null to string functions for PHP 8.1
1 parent 86c710a commit 85e65b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Controllers/BaseController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public function listviewRow($row)
261261
}
262262
$response .= '<span>' . $value . '</span>';
263263
} elseif ($this->columns($column, 'type') == 'date') {
264-
$response .= '<span>' . str_replace(' 00:00:00', '', $row[$column]) . '</span>';
264+
$response .= '<span>' . str_replace(' 00:00:00', '', $row[$column] ?: '') . '</span>';
265265
} elseif ($this->columns($column, 'type') == 'select' && isset($this->columns($column, 'values')[$row[$column]])) {
266266
$value = $this->columns($column, 'values')[$row[$column]];
267267
if (is_array($value)) {
@@ -279,7 +279,7 @@ public function listviewRow($row)
279279
if ($value instanceof Collection) {
280280
$value = $value->count() ?: '';
281281
}
282-
$response .= '<span>' . htmlspecialchars($value) . '</span>';
282+
$response .= '<span>' . htmlspecialchars($value ?: '') . '</span>';
283283
}
284284
}
285285
return $response;

0 commit comments

Comments
 (0)