return null version on null userAgentString

otherwise you'll get NPE on matching on the version fetcher.
This commit is contained in:
Nadav Wexler
2018-08-12 16:29:33 +03:00
committed by GitHub
parent 789ab6728f
commit 78cfcac7d0

View File

@@ -427,6 +427,10 @@ public enum Browser {
* @return Version
*/
public Version getVersion(String userAgentString) {
if (userAgentString == null) {
return null;
}
if (versionFetcher == null) {
return getGroup() != this ? getGroup().getVersion(userAgentString) : null;
}