component is being set to null after edit

the replicated code was just to test something

what code can make something be null only when its class is changed and rebuilt?
it happens if i add a property in the component, change the name or the type of an existing property, or when adding a method.