From 5c47fed51a768e04064d0db0e7ec3ce09558a35a Mon Sep 17 00:00:00 2001
From: Marcel Korzonek <marcel@xirado.dev>
Date: Sun, 10 Nov 2024 03:00:20 +0100
Subject: [PATCH] Add button label null check in ButtonImpl#toData

---
 .../dv8tion/jda/internal/interactions/component/ButtonImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/net/dv8tion/jda/internal/interactions/component/ButtonImpl.java b/src/main/java/net/dv8tion/jda/internal/interactions/component/ButtonImpl.java
index c2d81caa94..c35b1999a1 100644
--- a/src/main/java/net/dv8tion/jda/internal/interactions/component/ButtonImpl.java
+++ b/src/main/java/net/dv8tion/jda/internal/interactions/component/ButtonImpl.java
@@ -171,7 +171,7 @@ public DataObject toData()
     {
         DataObject json = DataObject.empty();
         json.put("type", 2);
-        if (!label.isEmpty())
+        if (label != null && !label.isEmpty())
             json.put("label", label);
         json.put("style", style.getKey());
         json.put("disabled", disabled);