LalitMaganti / Relay

An open source IRC library for Android apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash on connecting to Slack IRC through ZNC with buffered history

pR0Ps opened this issue · comments

I see the following crash in the HoloIRC Android app after trying to connect to the Slack IRC bridge using ZNC with history in the buffer. There may also be other ways to trigger the crash.

The app crashes the first time I connect, then works every time after that, I'm thinking It might be something to do with history playback.

I did a little digging and narrowed the error down to the line here in the Relay library. Looks like with the particular line ":irc.tinyspeck.com 305 :You are no longer marked as being away" (from the logcat) there are exactly 3 strings in parsedArray so when the first 3 are removed, there's nothing left. Trying to get the first element then causes a crash.

Logcat:

02-20 12:39:38.897 I/Timeline(817): Timeline: Activity_windows_visible id: ActivityRecord{42697698 u0 com.fusionx.lightirc/.ui.MainActivity t205} time:318515182
02-20 12:39:40.397 D/AndroidRuntime(16153): Shutting down VM
02-20 12:39:40.397 W/dalvikvm(16153): threadid=1: thread exiting with uncaught exception (group=0x415c8ce0)
02-20 12:39:40.537 E/AndroidRuntime(16153): FATAL EXCEPTION: main
02-20 12:39:40.537 E/AndroidRuntime(16153): Process: com.fusionx.lightirc, PID: 16153
02-20 12:39:40.537 E/AndroidRuntime(16153): java.lang.RuntimeException: :irc.tinyspeck.com 305 :You are no longer marked as being away
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.lambda$null$3(RelayIRCConnection.java:91)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.access$lambda$6(RelayIRCConnection.java)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection$$Lambda$9.run(Unknown Source)
02-20 12:39:40.537 E/AndroidRuntime(16153): at android.os.Handler.handleCallback(Handler.java:733)
02-20 12:39:40.537 E/AndroidRuntime(16153): at android.os.Handler.dispatchMessage(Handler.java:95)
02-20 12:39:40.537 E/AndroidRuntime(16153): at android.os.Looper.loop(Looper.java:136)
02-20 12:39:40.537 E/AndroidRuntime(16153): at android.app.ActivityThread.main(ActivityThread.java:5146)
02-20 12:39:40.537 E/AndroidRuntime(16153): at dalvik.system.NativeStart.main(Native Method)
02-20 12:39:40.537 E/AndroidRuntime(16153): Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
02-20 12:39:40.537 E/AndroidRuntime(16153): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
02-20 12:39:40.537 E/AndroidRuntime(16153): at java.util.ArrayList.get(ArrayList.java:308)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.parser.main.ServerLineParser.onParseServerCode(ServerLineParser.java:133)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.parser.main.ServerLineParser.parseLine(ServerLineParser.java:99)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.parser.main.ServerLineParser.parseMain(ServerLineParser.java:62)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.onStartParsing(RelayIRCConnection.java:250)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.connect(RelayIRCConnection.java:207)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.connectToServer(RelayIRCConnection.java:135)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.lambda$startConnection$4(RelayIRCConnection.java:88)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection.access$lambda$0(RelayIRCConnection.java)
02-20 12:39:40.537 E/AndroidRuntime(16153): at co.fusionx.relay.base.relay.RelayIRCConnection$$Lambda$1.run(Unknown Source)
02-20 12:39:40.537 E/AndroidRuntime(16153): at java.lang.Thread.run(Thread.java:841)
02-20 12:39:40.547 W/ActivityManager(817): Force finishing activity com.fusionx.lightirc/.ui.MainActivity
02-20 12:39:41.167 W/ActivityManager(817): Activity pause timeout for ActivityRecord{42697698 u0 com.fusionx.lightirc/.ui.MainActivity t205 f}
02-20 12:39:41.797 I/Timeline(1971): Timeline: Activity_idle id: android.os.BinderProxy@41e1ed28 time:318518080
02-20 12:39:43.787 I/ActivityManager(817): Process com.fusionx.lightirc (pid 16153) has died.
02-20 12:39:43.787 I/WindowState(817): WIN DEATH: Window{437c3628 u0 com.fusionx.lightirc/com.fusionx.lightirc.ui.MainActivity}
02-20 12:39:43.787 W/ActivityManager(817): Service crashed 2 times, stopping: ServiceRecord{42eb6b08 u0 com.fusionx.lightirc/.service.IRCService}