Skip to content

Commit

Permalink
fixed bug when user does not have any key
Browse files Browse the repository at this point in the history
  • Loading branch information
HUET Benjamin committed Mar 5, 2017
1 parent b9030e8 commit 63e273d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Http/Controllers/OperationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function index()
});

$userCharacters = $this->getUserCharacters(auth()->user()->id)->unique('characterID')->sortBy('characterName');
if(setting('main_character_id') != 1) {
if(setting('main_character_id') != 1 && $userCharacters->count() > 0) {
$mainCharacter = $userCharacters->where('characterID', '=', setting('main_character_id'))->first();
$mainCharacter->main = true;
$userCharacters = $userCharacters->reject(function ($character) {
Expand Down

0 comments on commit 63e273d

Please sign in to comment.