We have PB Response Selection window that sometimes crashes with a Null Object Reference (PB17)
The window has a Event which does A Retreval on the main datawindow (dw_1) using the entry in a sle
User Selects a Row - presses Ok and the Default window event grabs the value from the selected row and returns to the calling window with return.
It appears that sometimes - if the user types quickly after already selecting a row, that the Retrieve Process is initiated while the window is being closed and the retrun from the retieve process falls into code which fails because the datawindow control pointer is no longer valid.
Ive tried to trap this with the Valid test
IF NOT isValid(dw_1) THEN RETURN
But the program still crashes with an Null Object Reference on this statement.
Any ideas whats going on and how I can avoid the crash
As this is in the Reponse Windows Event Script - are you suggesting I use IF IsValid(this)?
Whats odd is that I have code in the window executing where the window is already being shut down. Yields don't seem to make a difference.
I imagine there is a close going on - as this is in the pfc - perhaps there is some variable set at the window that I can test.
I have to check in several places (in the Close() event) if the window is still really valid or not. Can't remember exactly why, but it has happened to me in certain circumstances.
regards.