check for null value insert (#2350)

Co-authored-by: SerpentSpirale <serpentspirale@gmail.com>
This commit is contained in:
ArtDev 2021-12-07 21:23:42 +03:00 committed by GitHub
parent 095b62a100
commit 870d86d9ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,6 +43,8 @@ public final class ExtraCore {
* @param value The value
*/
public static void setValue(String key, Object value){
if(value == null || key == null) return; // null values create an NPE on insertion
getInstance().valueMap.put(key, value);
ConcurrentLinkedQueue<WeakReference<ExtraListener>> extraListenerList = getInstance().listenerMap.get(key);
if(extraListenerList == null) return; //No listeners