Skip to content

Commit

Permalink
Allow unknown type label
Browse files Browse the repository at this point in the history
  • Loading branch information
dizzystuff committed Jul 4, 2024
1 parent 9f2f862 commit 85f9dd0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Model/EmbedObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ class EmbedObject extends DataObject

public function getTypeLabel(): string
{
switch ($this->Type) {
$type = $this->Type;
if (empty($type)) $type = 'Unknown';
switch ($type) {
case 'video':
return 'Video';
case 'rich':
Expand All @@ -54,7 +56,7 @@ public function getTypeLabel(): string
case 'photo':
return 'Image';
default:
return $this->Type;
return $type;
}
}

Expand Down

0 comments on commit 85f9dd0

Please sign in to comment.