diff options
| author | abranson <andrew.branson@cern.ch> | 2012-03-13 16:00:10 +0100 |
|---|---|---|
| committer | abranson <andrew.branson@cern.ch> | 2012-03-13 16:00:10 +0100 |
| commit | 97bf49e5642abdef8ca24e31aeeb82e6547ce584 (patch) | |
| tree | 616a75b4b855a556ef57271cf88c2856649b534e /source/com/c2kernel/utils/SoftCache.java | |
| parent | d25fe5aaf94e1e0037b53d35f11f8885f6aa9042 (diff) | |
Fix NPE when key doesn't exist
Diffstat (limited to 'source/com/c2kernel/utils/SoftCache.java')
| -rw-r--r-- | source/com/c2kernel/utils/SoftCache.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/com/c2kernel/utils/SoftCache.java b/source/com/c2kernel/utils/SoftCache.java index ff71222..2fd79f1 100644 --- a/source/com/c2kernel/utils/SoftCache.java +++ b/source/com/c2kernel/utils/SoftCache.java @@ -62,7 +62,8 @@ public class SoftCache<K, V> extends AbstractMap<K, V> { @Override
public V remove(Object key) {
processQueue();
- return hash.remove(key).get();
+ if (hash.containsKey(key)) return hash.remove(key).get();
+ return null;
}
@Override
|
