Don't allow sync callbacks to crash the sync thread

pull/14/head
Sam Bosley 13 years ago
parent 5b200ec849
commit 7664049f7e

@ -223,9 +223,13 @@ public class ActFmSyncThread {
} }
for (ClientToServerMessage<?> message : messageBatch) { for (ClientToServerMessage<?> message : messageBatch) {
try {
Runnable r = pendingCallbacks.remove(message); Runnable r = pendingCallbacks.remove(message);
if (r != null) if (r != null)
r.run(); r.run();
} catch (Exception e) {
Log.e(ERROR_TAG, "Unexpected exception executing sync callback", e);
}
} }
if (refreshAfterBatch) { if (refreshAfterBatch) {
Intent refresh = new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH); Intent refresh = new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH);

Loading…
Cancel
Save