Skip to content

Commit

Permalink
Fix more PHP warnings and notices
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Feb 28, 2020
1 parent f8ef1b3 commit 8c68060
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion system/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function getGuildLink($name, $generate = true)
function getItemNameById($id) {
require_once LIBS . 'items.php';
$item = Items::get($id);
return $item['name'];
return !empty($item['name']) ? $item['name'] : '';
}

function getItemImage($id, $count = 1)
Expand Down
2 changes: 1 addition & 1 deletion system/libs/items.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static function load() {

public static function get($id) {
self::load();
return self::$items[$id];
return isset(self::$items[$id]) ? self::$items[$id] : [];
}

public static function getDescription($id, $count = 1) {
Expand Down

0 comments on commit 8c68060

Please sign in to comment.