Skip to content

Commit 9d63cf4

Browse files
committed
Incorrect variable adding fixed.
Signed-off-by: Pavel Erokhin (MairwunNx) <[email protected]>
1 parent 5bb8cd8 commit 9d63cf4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/kotlin/com/mairwunnx/projectessentials/chat/api/variables/ChatVariableAPI.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ object ChatVariableAPI {
2222
*/
2323
fun add(variable: IChatVariable) = synchronized(store) {
2424
store.find { it.variable == variable.variable }?.let {
25-
store.add(variable).also {
26-
getLogger().debug("Chat variable (${variable.variable}) added.")
27-
}.let { return@synchronized }
28-
} ?: run {
2925
getLogger().error(
3026
"Chat variable `${variable.javaClass.canonicalName}` (${variable.variable}) already exist."
3127
)
28+
} ?: run {
29+
store.add(variable).also {
30+
getLogger().debug("Chat variable (${variable.variable}) added.")
31+
}.let { return@synchronized }
3232
}
3333
}
3434

0 commit comments

Comments
 (0)