File tree Expand file tree Collapse file tree
dash/src/pages/server/[serverId] Expand file tree Collapse file tree Original file line number Diff line number Diff 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 >
You can’t perform that action at this time.
0 commit comments