Fix error will null/undefined values