matcher null pointer fix

This commit is contained in:
amoghbl1 2014-06-20 02:20:13 +05:30
parent ff8bf0bddf
commit 367002bf3d
1 changed files with 5 additions and 4 deletions

View File

@ -1440,11 +1440,12 @@ public class TorService extends Service implements TorServiceConstants, TorConst
Pattern pattern = Pattern.compile(IPADDRESS_PATTERN); Pattern pattern = Pattern.compile(IPADDRESS_PATTERN);
Matcher matcher = null; Matcher matcher = null;
if(nodeDetails!=null) if(nodeDetails!=null){
matcher = pattern.matcher(nodeDetails); matcher = pattern.matcher(nodeDetails);
if (matcher!=null && matcher.find()) { if (matcher.find()) {
Log.d(TAG, "ip: "+matcher.group()); Log.d(TAG, "ip: "+matcher.group());
exitIP = matcher.group(); exitIP = matcher.group();
}
} }
} }
} }