Skip to content

Commit

Permalink
Fix monster not found exception
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Jul 10, 2024
1 parent 9a27403 commit ef79b99
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions system/pages/monsters.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@

// display monster
$monster_name = urldecode(stripslashes(ucwords(strtolower($_REQUEST['name']))));
$monster = Monster::where('hide', '!=', 1)->where('name', $monster_name)->first()->toArray();
$monster = Monster::where('hide', '!=', 1)->where('name', $monster_name)->first();

if ($monster && isset($monster->name)) {
$monster = $monster->toArray();

Check failure on line 45 in system/pages/monsters.php

View workflow job for this annotation

GitHub Actions / PhpStan on PHP 8.1

Call to an undefined method object::toArray().

Check failure on line 45 in system/pages/monsters.php

View workflow job for this annotation

GitHub Actions / PhpStan on PHP 8.2

Call to an undefined method object::toArray().

Check failure on line 45 in system/pages/monsters.php

View workflow job for this annotation

GitHub Actions / PhpStan on PHP 8.3

Call to an undefined method object::toArray().

if (isset($monster['name'])) {
function sort_by_chance($a, $b)
{
if ($a['chance'] == $b['chance']) {
Expand Down

0 comments on commit ef79b99

Please sign in to comment.