Fix: don't throw an exception when sanitizing nil