Smack 4.4.6: NPE in Roster#deleteEntry() method cause aTalk to crash

Below is an extraction of the Google Play Console, Crashes and ANRs Stack trace reported for aTalk v3.1.4 release based on smack 4.4.6.

I do not have any more info on why this occurred. May be your team can take a look if NPE can be prevented, avoiding app crashes

Stack trace:

Sample attributes:
a. HUAWEI HWAMN-M (HUAWEI Y5 2019)
b. Android 9 (SDK 28)
c. Version: 301040 (3.1.4)Occurred: 4 days ago

Type: java.lang.NullPointerException

Exception java.lang.NullPointerException:
  at org.jivesoftware.smack.roster.Roster.deleteEntry (Roster.java:1412)
  at org.jivesoftware.smack.roster.Roster.access$2000 (Roster.java:96)
  at org.jivesoftware.smack.roster.Roster$RosterResultListener.onSuccess (Roster.java:1724)
  at org.jivesoftware.smack.roster.Roster$RosterResultListener.onSuccess (Roster.java:1687)
  at org.jivesoftware.smack.SmackFuture$1.run (SmackFuture.java:182)
  at java.util.concurrent.ThreadPoolExecutor.processTask (ThreadPoolExecutor.java:1187)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:784)

After walking through the smack Roster source, I see that this happens only if the RosterIQ packet received contains an invalid RosterEntry where its item attribute is missing or contains and empty jid string. Not sure if this is due to improper configuration of the server roster group.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.