I'm trying to download some images from the internet. When there is an error the user is asked if he wants to continue or pause downloading. For a long time I have used the code below to show a dialog:
theMessage = hasMessage Button = hasButton dim currentThread as Thread = App.CurrentThread if currentThread = nil then HandleAction(Nil) return end if 'create the timer me.ShowDialog = new DelegatingTimer me.ShowDialog.Mode = 1 me.ShowDialog.Period = 100 me.ShowDialog.Action = AddressOf me.HandleAction theThread = currentThread theThread.suspend
where the dialog is shown in HandleAction. However, today I'm totally astonished to get a NilObjectException in the last line. The debugger shows me that theThread is not Nil. The assignment is only made when currentThread isn't Nil. So how can there be a NOE?
The download is an additional feature of a parser which can continue without downloading. So if there are network problem I'd like to ask if the use want to continue or not.
Does anyone have an idea what might be going on here?
Xojo 2018r3, High Sierra.