You've already forked Epicnabbo-Catalogus-Updated-Daily
Update HabboBadgeColumn.php
This commit is contained in:
@@ -13,21 +13,23 @@ class HabboBadgeColumn extends Column implements HasBadge
|
|||||||
{
|
{
|
||||||
$record = $this->getRecord();
|
$record = $this->getRecord();
|
||||||
|
|
||||||
if (! method_exists($record, 'getBadgePath')) {
|
if (! is_object($record) || ! method_exists($record, 'getBadgePath')) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $record->getBadgePath();
|
$path = $record->getBadgePath();
|
||||||
|
return is_string($path) ? $path : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBadgeName(): string
|
public function getBadgeName(): string
|
||||||
{
|
{
|
||||||
$record = $this->getRecord();
|
$record = $this->getRecord();
|
||||||
|
|
||||||
if (! method_exists($record, 'getBadgeName')) {
|
if (! is_object($record) || ! method_exists($record, 'getBadgeName')) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $record->getBadgeName();
|
$name = $record->getBadgeName();
|
||||||
|
return is_string($name) ? $name : '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user