Prevent crash with corrupted map layer