diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java b/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java index b5fc88bdd..6f3152cab 100644 --- a/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java @@ -13,6 +13,9 @@ import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.services.XmppConnectionService; +import eu.siacs.conversations.xmpp.jid.InvalidJidException; +import eu.siacs.conversations.xmpp.jid.Jid; + import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; @@ -87,12 +90,15 @@ public class ExceptionHelper { public void onClick(DialogInterface dialog, int which) { Log.d(Config.LOGTAG, "using account=" - + finalAccount.getJid() + + finalAccount.getJid().toBareJid() + " to send in stack trace"); - Conversation conversation = service - .findOrCreateConversation(finalAccount, - "bugs@siacs.eu", false); - Message message = new Message(conversation, report + Conversation conversation = null; + try { + conversation = service.findOrCreateConversation(finalAccount, + Jid.fromString("bugs@siacs.eu"), false); + } catch (final InvalidJidException ignored) { + } + Message message = new Message(conversation, report .toString(), Message.ENCRYPTION_NONE); service.sendMessage(message); } @@ -103,15 +109,12 @@ public class ExceptionHelper { @Override public void onClick(DialogInterface dialog, int which) { preferences.edit().putBoolean("never_send", true) - .commit(); + .apply(); } }); builder.create().show(); - } catch (FileNotFoundException e) { - return; - } catch (IOException e) { - return; - } + } catch (final IOException ignored) { + } } } |