Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ab9b1e7 authored by Kun Liang's avatar Kun Liang Committed by Gerrit - the friendly Code Review server
Browse files

AppOps: add null pointer check for isMmsRequest

Fix the Java exception which is caused by null pointer issue in
AndroidHttpClient.

Change-Id: I769229c37b17932c9b00eaa1d0303b603a8ebea1
parent 9862390e
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -257,8 +257,15 @@ public final class AndroidHttpClient implements HttpClient {

    private boolean isMmsRequest()
    {
        if(delegate.getParams().getParameter(CoreProtocolPNames.USER_AGENT).toString().contains("Android-Mms"))
        if (delegate != null) {
            HttpParams httpParams = delegate.getParams();
            if (httpParams != null) {
                Object parameter = httpParams.getParameter(CoreProtocolPNames.USER_AGENT);
                if (parameter != null && parameter.toString().contains("Android-Mms")) {
                    return true;
                }
            }
        }

        return false;
    }