Update HabboBadgeColumn.php
This commit is contained in:
1 parent
1d3f30e43d
commit
2c48253924
1 file changed
+6
-4
@@ -13,21 +13,23 @@ class HabboBadgeColumn extends Column implements HasBadge
|
||||
{
|
||||
$record = $this->getRecord();
|
||||
|
||||
if (! method_exists($record, 'getBadgePath')) {
|
||||
if (! is_object($record) || ! method_exists($record, 'getBadgePath')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $record->getBadgePath();
|
||||
$path = $record->getBadgePath();
|
||||
return is_string($path) ? $path : '';
|
||||
}
|
||||
|
||||
public function getBadgeName(): string
|
||||
{
|
||||
$record = $this->getRecord();
|
||||
|
||||
if (! method_exists($record, 'getBadgeName')) {
|
||||
if (! is_object($record) || ! method_exists($record, 'getBadgeName')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $record->getBadgeName();
|
||||
$name = $record->getBadgeName();
|
||||
return is_string($name) ? $name : '';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user