Skip to content

Commit 0bc7d70

Browse files
committed
bug stays?
1 parent 4182ab3 commit 0bc7d70

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

dash/src/pages/server/[serverId]/settings.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ export default function ServerSettings() {
153153
return
154154
}
155155

156+
if (!guildData) {
157+
showMessage('error', 'Guild data not loaded')
158+
return
159+
}
160+
156161
const role = guildData.roles.find((r) => r.id === newRewardRoleId)
157162
if (!role) {
158163
showMessage('error', 'Role not found')
@@ -228,7 +233,7 @@ export default function ServerSettings() {
228233
className="w-full bg-discord-dark text-white p-3 rounded-lg border border-gray-700 focus:border-discord-blue focus:outline-none"
229234
>
230235
<option value="">No specific channel (use current channel)</option>
231-
{guildData.channels.map((channel) => (
236+
{guildData?.channels.map((channel) => (
232237
<option key={channel.id} value={channel.id}>
233238
# {channel.name}
234239
</option>
@@ -290,7 +295,7 @@ export default function ServerSettings() {
290295
className="bg-discord-dark text-white p-3 rounded-lg border border-gray-700 focus:border-discord-blue focus:outline-none"
291296
>
292297
<option value="">Select a role...</option>
293-
{guildData.roles.map((role) => (
298+
{guildData?.roles.map((role) => (
294299
<option key={role.id} value={role.id}>
295300
@{role.name}
296301
</option>

0 commit comments

Comments
 (0)