Fix API issue

parent 040fcf24
Pipeline #1333 passed with stages
in 3 minutes and 1 second
......@@ -108,7 +108,7 @@ class Client extends Http
}
}
return [$data['id'], $account];
return [$data['id'], $account ?? null];
}
//---------------------------------------------------------------------------------
......
......@@ -59,6 +59,10 @@ class ApiV1Controller extends Controller
// Check if platform exists.
[$id, $account] = $client->getAccountByTag($all['gamertag'], $all['platform']);
if ($account === null) {
return $this->_error('This username could not be found. We need EPIC username + platform of system (xbl/psn/pc');
}
$msg = 'Account (' . $id . ') was found. Added into system. `/bot fn` will work.';
$client->setPandaAuth($user);
$client->getAccountRoyaleStats($account, $id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment