[SOLVED] PluginOneSignal getTags bug

Hey guys,

I think I found a bug in OneSignal plugin. When I call PluginOneSignal::getTags for a user who doesn’t have any tags on one signal platform, I got fatal exception like that:

04-23 17:54:26.626 1318-1485/com.something.example E/AndroidRuntime: FATAL EXCEPTION: Thread-6811
Process: com.something.example, PID: 1318
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.toString()' on a null object reference
at com.sdkbox.plugin.PluginOneSignal$1.tagsAvailable(PluginOneSignal.java:110)
at com.onesignal.OneSignal$8.run(OneSignal.java:792)
at java.lang.Thread.run(Thread.java:818)

This bug doesn’t occur if current one signal user has any tags. Also it only occurs in Android platform. I guess it needs a minor null checking or something like that.

I can provide more details or codes if necessary.

@nite I think I should tag you :slight_smile:

Thanks for your report, I’ll fix this issue.

I updated the PluginOneSignal from 2.3.13.2 to 2.3.13.5 and it is not crashing anymore.
Thank you :slight_smile: