Skip to content

Commit 936a3b8

Browse files
committed
Fix Label::setDescription
1 parent 4e59844 commit 936a3b8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Discord/Builders/Components/Label.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,14 @@ public function setLabel(string $label): self
110110
*/
111111
public function setDescription(?string $description = null): self
112112
{
113-
if (poly_strlen($description) === 0) {
114-
$description = null;
115-
}
116-
117-
if (poly_strlen($description) > 100) {
118-
throw new \LengthException('Description must be between 0 and 100 in length.');
113+
if (isset($description)) {
114+
if (poly_strlen($description) === 0) {
115+
$description = null;
116+
}
117+
118+
if (poly_strlen($description) > 100) {
119+
throw new \LengthException('Description must be between 0 and 100 in length.');
120+
}
119121
}
120122

121123
$this->description = $description;

0 commit comments

Comments
 (0)