Skip to content
Snippets Groups Projects
Commit 00a9cdd4 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Avoid crashing due to invalid sync messages

parent 64491b55
No related branches found
No related tags found
No related merge requests found
Pipeline #3065 failed
......@@ -30,6 +30,7 @@ import de.kuschku.libquassel.quassel.syncables.interfaces.ISyncableObject
import de.kuschku.libquassel.quassel.syncables.interfaces.invokers.Invokers
import de.kuschku.libquassel.util.compatibility.LoggingHandler.Companion.log
import de.kuschku.libquassel.util.compatibility.LoggingHandler.LogLevel.DEBUG
import de.kuschku.libquassel.util.compatibility.LoggingHandler.LogLevel.ERROR
import java.io.Closeable
abstract class ProtocolHandler(
......@@ -117,6 +118,7 @@ abstract class ProtocolHandler(
open fun onInitStatusChanged(progress: Int, total: Int) {}
override fun handle(f: SignalProxyMessage.SyncMessage): Boolean {
try {
val obj = objectStorage.get(f.className, f.objectName) ?: if (isInitializing) {
syncQueue.add(f)
return true
......@@ -142,6 +144,9 @@ abstract class ProtocolHandler(
currentCallSlot = ""
}
}
} catch (e: Exception) {
log(ERROR, "ProtocolHandler", "Exception occurred while processing $f", e)
}
return true
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment