diff --git a/app/Library/Lookups/LookupHelper.php b/app/Library/Lookups/LookupHelper.php index 149013f6c..bc51c824b 100644 --- a/app/Library/Lookups/LookupHelper.php +++ b/app/Library/Lookups/LookupHelper.php @@ -310,13 +310,13 @@ class LookupHelper { public function CorporationNameToId($corpName) { //Check if the corporation is stored in our own database first $corp = $this->LookupCorporation(null, $corpName); - dd($corp); + if($corp != null) { return $corp->corporation_id; } else { //Try to get the corporation details from ESI try { - $corporation = $this->esi->setBody(array( + $response = $this->esi->setBody(array( $corpName, ))->invoke('post', '/universe/ids/'); } catch(RequestFailedException $e) { @@ -324,6 +324,8 @@ class LookupHelper { return null; } + dd($response); + if(isset($response->corporations[0]->id)) { $this->StoreCorporationLookup($response->corporations[0]->id, null);