mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-15 18:24:56 +02:00
Fix monster not found exception
This commit is contained in:
@@ -39,9 +39,11 @@ if (empty($_REQUEST['name'])) {
|
|||||||
|
|
||||||
// display monster
|
// display monster
|
||||||
$monster_name = urldecode(stripslashes(ucwords(strtolower($_REQUEST['name']))));
|
$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();
|
||||||
|
|
||||||
if (isset($monster['name'])) {
|
|
||||||
function sort_by_chance($a, $b)
|
function sort_by_chance($a, $b)
|
||||||
{
|
{
|
||||||
if ($a['chance'] == $b['chance']) {
|
if ($a['chance'] == $b['chance']) {
|
||||||
|
Reference in New Issue
Block a user