Check key is not null since ConcurrentHashMap breaks with null key