Skip to content

Commit

Permalink
[Fixed] Fixed error issue if no invincible items have been setup #3
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Sep 27, 2017
1 parent 1740788 commit d4df135
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions services/BorisService.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@ public function invincible( $ids, $invincibleIds )

$invincibleTitles = array();

foreach ( $ids as $id ) {
if ( $invincibleIds and !empty( $invincibleIds ) ) {
foreach ( $ids as $id ) {

if ( in_array( $id, $invincibleIds ) ) {
$element = craft()->elements->getElementById( $id );
if ( $element ) {
$invincibleTitles[] = $element->title;
if ( in_array( $id, $invincibleIds ) ) {
$element = craft()->elements->getElementById( $id );
if ( $element ) {
$invincibleTitles[] = $element->title;
}
}
}

}
}

return $invincibleTitles;
Expand Down

0 comments on commit d4df135

Please sign in to comment.