1
1
Fork 0

catching nulls for FileTag

This commit is contained in:
Philipp Holzer 2019-05-30 13:54:17 +02:00
commit c76258c370
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
4 changed files with 8 additions and 8 deletions

View file

@ -186,7 +186,7 @@ function get_cats_and_terms($item)
$folders = [];
$first = true;
foreach (FileTag::fileToArray($item['file'], 'category') as $savedFolderName) {
foreach (FileTag::fileToArray($item['file'] ?? '', 'category') as $savedFolderName) {
$categories[] = [
'name' => $savedFolderName,
'url' => "#",
@ -202,7 +202,7 @@ function get_cats_and_terms($item)
}
if (local_user() == $item['uid']) {
foreach (FileTag::fileToArray($item['file']) as $savedFolderName) {
foreach (FileTag::fileToArray($item['file'] ?? '') as $savedFolderName) {
$folders[] = [
'name' => $savedFolderName,
'url' => "#",