fix crash when attempting to assign value at nil index of an object