Add null check for the return value of `ReferenceQueue#remove()`
@@ -258,8 +258,10 @@ abstract class AbstractWeakConcurrentMap<K, V, L> implements Iterable<Map.Entry<
try {
while (!Thread.interrupted()) {
Reference<?> reference = REFERENCE_QUEUE.remove();
+ if (reference != null) {
removeWeakKey((WeakKey<?>) reference);
}
+ }
} catch (InterruptedException ignored) {
// do nothing
}
