Error on Property Change Script

I created a property change script that is supposed to open a pop up if the color of the label changes. The pop up seems to work fine and as it is supposed to, but now whenever I open up the page in the designer, I am getting this error:

Here is the script the error is referring to:

def valueChanged(self, previousValue, currentValue, origin, missedEvents):
	if previousValue.value != currentValue.value:
			system.perspective.openPopup('FlashingPopup_RMC', 'OperationsPages/FlashingPopup_RMC')

I am confused because the pop up function is work as planned. Any ideas on how to address/fix this error?

NoneType object has no attribute X is the Python equivalent of a null pointer exception.

When you first open the view, there is no previousValue. So previousValue.value... doesn't exist.

Try:

	if previousValue is not None and previousValue.value != currentValue.value:

I had the same issue. Checking for not initalChange works as well.

Doesn't exist for Perspective property change events.

ah, yes. I forget it exists because I basically don't use it :sweat_smile: