<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_if_changed(self, resource):
 """Add resource if change is not None else ChangeTypeError."""

        if (resource.change is not None):
            self.resources.append(resource)
        else:
            raise ChangeTypeError(resource.change)