Skip to content

Commit bf59efb

Browse files
committed
check whether it exists
1 parent aba818b commit bf59efb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/responses/guild/GuildRanks.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ public function getRanks() {
5454
* @return GuildRank
5555
*/
5656
public function getRank($rank) {
57-
return $this->ranks[strtolower($rank)];
57+
if (array_key_exists(strtolower($rank), $this->ranks)) {
58+
return $this->ranks[strtolower($rank)];
59+
}
60+
return null;
5861
}
5962

6063
/**

0 commit comments

Comments
 (0)