make sure dict is not adding None objects

There are two commits, the first one is the fix, the second one fixes the two space indentation of the whole task.