diff --git a/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java index fc5be53389..7b549d7c62 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java @@ -304,12 +304,7 @@ public class PushMediaSendJob extends PushSendJob implements InjectableType { } SendMessageResult result = messageSender.sendMessage(messageId, address, UnidentifiedAccessUtil.getAccessFor(context, recipient), mediaMessage, Optional.fromNullable(syncMessage)); if (result.getLokiAPIError() != null) { - Throwable lokiAPIError = result.getLokiAPIError(); - if (lokiAPIError instanceof LokiAPI.Error) { // Should always be true - throw (LokiAPI.Error) lokiAPIError; - } else { - return result.getSuccess().isUnidentified(); - } + throw result.getLokiAPIError(); } else { return result.getSuccess().isUnidentified(); } diff --git a/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java index 878be38315..6d44fc9b5c 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java @@ -253,12 +253,7 @@ public class PushTextSendJob extends PushSendJob implements InjectableType { } SendMessageResult result = messageSender.sendMessage(messageId, address, unidentifiedAccess, textSecureMessage, Optional.fromNullable(syncMessage)); if (result.getLokiAPIError() != null) { - Throwable lokiAPIError = result.getLokiAPIError(); - if (lokiAPIError instanceof LokiAPI.Error) { // Should always be true - throw (LokiAPI.Error) lokiAPIError; - } else { - return result.getSuccess().isUnidentified(); - } + throw result.getLokiAPIError(); } else { return result.getSuccess().isUnidentified(); }