[3.0] Fixed crash issue by referencing unallocated memory