Why create ItemType(0)? Just write an if statement to check if corpse isn't nil before initializing ItemType of the corpse.