report wrong alarm data

This commit is contained in:
Milos Kozak 2017-10-13 08:11:30 +02:00
parent 45a2eba0c2
commit 91e286b2ae

View file

@ -9,6 +9,7 @@ import android.os.HandlerThread;
import android.os.IBinder;
import android.os.PowerManager;
import com.crashlytics.android.Crashlytics;
import com.google.common.base.Charsets;
import com.google.common.hash.Hashing;
import com.j256.ormlite.dao.CloseableIterator;
@ -352,7 +353,13 @@ public class NSClientService extends Service {
public void call(final Object... args) {
if (Config.detailedLog)
MainApp.bus().post(new EventNSClientNewLog("ALARM", "received"));
JSONObject data = (JSONObject) args[0];
JSONObject data;
try {
data = (JSONObject) args[0];
} catch (ClassCastException e) {
Crashlytics.log("Wrong alarm from NS: " + args[0]);
return;
}
BroadcastAlarm.handleAlarm(data, getApplicationContext());
log.debug(data.toString());
}