Skip to content

Commit

Permalink
Don't allow UnknownHostExceptions to be reported
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumBadger committed Sep 17, 2020
1 parent ea49f69 commit f3379e2
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import org.quantumbadger.redreader.activities.BugReportActivity;
import org.quantumbadger.redreader.common.RRError;

import java.net.UnknownHostException;

public final class ErrorPropertiesDialog extends PropertiesDialog {

private AppCompatActivity mContext;
Expand Down Expand Up @@ -67,9 +69,12 @@ public static ErrorPropertiesDialog newInstance(final RRError error) {
@Override
protected void interceptBuilder(@NonNull final AlertDialog.Builder builder) {

builder.setPositiveButton(
R.string.button_error_send_report,
(dialog, which) -> BugReportActivity.sendBugReport(mContext, mError));
if(!(mError.t instanceof UnknownHostException)) {

builder.setPositiveButton(
R.string.button_error_send_report,
(dialog, which) -> BugReportActivity.sendBugReport(mContext, mError));
}
}

@Override
Expand Down

0 comments on commit f3379e2

Please sign in to comment.