Skip to content

Commit 29b0709

Browse files
committed
Fixed code flow on failure
1 parent 7aae60e commit 29b0709

File tree

1 file changed

+2
-2
lines changed
  • common/src/main/kotlin/com/lambda/module/modules/client

1 file changed

+2
-2
lines changed

common/src/main/kotlin/com/lambda/module/modules/client/Discord.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ object Discord : Module(
108108
}
109109

110110
val (party, error) = createParty()
111-
if (error != null) warn("Failed to create a party: ${error.errorData}")
111+
if (error != null) return warn("Failed to create a party: ${error.errorData}")
112112

113113
currentParty = party
114114
partyUpdates { currentParty = it }
@@ -121,7 +121,7 @@ object Discord : Module(
121121
if (!isDiscordLinked) return warn("You did not link your discord account")
122122

123123
val (party, error) = joinParty(id)
124-
if (error != null) warn("Failed to join the party: ${error.errorData}")
124+
if (error != null) return warn("Failed to join the party: ${error.errorData}")
125125

126126
currentParty = party
127127
partyUpdates { currentParty = it }

0 commit comments

Comments
 (0)