[GH-ISSUE #243] HTTPClient exceptions can crash MessageResultsController #178

Closed
opened 2026-02-28 01:23:34 +03:00 by kerem · 0 comments
Owner

Originally created by @ghost on GitHub (Jan 28, 2015).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/243

In the event of a SocketTimeoutException, getResponse can return null in the case of a caught exception in the following code block. Null checks need to be added to all the finally blocks surrounding HTTP requests.

catch (Exception e) {
            mUtil.log(mContext.getString(R.string.message_processed_failed));
        } finally {
            if (HttpStatus.SC_OK == client.getResponse().code()) {
                mUtil.log(mContext.getString(R.string.message_processed_success));
            }
        }
Originally created by @ghost on GitHub (Jan 28, 2015). Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/243 In the event of a SocketTimeoutException, getResponse can return null in the case of a caught exception in the following code block. Null checks need to be added to all the finally blocks surrounding HTTP requests. ``` java catch (Exception e) { mUtil.log(mContext.getString(R.string.message_processed_failed)); } finally { if (HttpStatus.SC_OK == client.getResponse().code()) { mUtil.log(mContext.getString(R.string.message_processed_success)); } } ```
kerem closed this issue 2026-02-28 01:23:34 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SMSSync#178
No description provided.