Check the hash table is not null before we remove it