Skip to content

Commit 019f3bf

Browse files
committed
fixed NPE
1 parent faa7d9c commit 019f3bf

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/main/java/cz/mallat/uasparser/MultithreadedUASparser.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ protected Set<Entry<Matcher, Long>> getBrowserMatcherSet() {
7373

7474
@Override
7575
protected Set<Entry<Matcher, Long>> getDeviceMatcherSet() {
76-
return compiledDeviceMatcherMapT.get().entrySet();
76+
Map<Matcher, Long> map = compiledDeviceMatcherMapT.get();
77+
if (map == null) {
78+
return null;
79+
}
80+
return map.entrySet();
7781
}
7882

7983
}

src/main/java/cz/mallat/uasparser/SingleThreadedUASparser.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ protected Set<Entry<Matcher, Long>> getBrowserMatcherSet() {
175175
}
176176

177177
protected Set<Entry<Matcher, Long>> getDeviceMatcherSet() {
178+
if (compiledDeviceMatcherMap == null) {
179+
return null;
180+
}
178181
return compiledDeviceMatcherMap.entrySet();
179182
}
180183

0 commit comments

Comments
 (0)