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

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

AppOps: Add null pointer check for USERAGENT parameter.

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

Change-Id: If7e36298f94ca164b87e1b0604f49156bdfd4513
parent 971799bd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -254,6 +254,11 @@ public final class AndroidHttpClient implements HttpClient {

    private boolean isMmsRequest()
    {
        if(delegate.getParams() == null ||
                delegate.getParams().getParameter(CoreProtocolPNames.USER_AGENT) == null) {
            return false;
        }

        if(delegate.getParams().getParameter(CoreProtocolPNames.USER_AGENT).toString().contains("Android-Mms"))
            return true;