Check for null maps before de-referencing