Understanding message UnhandledException

Can anyone tell me what is happening when I get this Exception Error.
Thanks Herman

2023-09-27 09:40:55 desktopPage.desktopPage.agenda_moveRide%%o<desktopPage.desktopPage>o<agendaContainer.agendaContainer>
Delegate.IM_Invoke%%o<agendaContainer.agendaContainer>
AddHandler.Stub.12%%
agendaContainer.agendaContainer.scroll_Pressed%%o<agendaContainer.agendaContainer>oi8i8
Delegate.IM_Invoke%%oi8i8
AddHandler.Stub.6%%i8i8
WebCanvas._ExecuteEvent%b%oso
WebSession._HandleEvent%%oso<_HTTPServer.HTTPRequestContext>
WebSession._HandleRequest%i8%oso<_HTTPServer.HTTPRequestContext>
WebApplication._HandleHTTPRequest%%oo<_HTTPServer.HTTPRequestContext>
_HTTPServer.HTTPRequestThread.Event_Run%%o<_HTTPServer.HTTPRequestThread>

We’re going to need to see the code in this method.

moveRide is a Event of Agenda.
Thanks for your attention, Greg.

var agdOK as boolean = true
var move as integer = m_agenda.index - m_agenda.selected

if m_agenda.selectedRide <> m_agenda.selected then return
if move = 0 then return

for i as integer = m_agenda.selectedFirst + move to m_agenda.selectedLast + move
if m_agenda.frame(i,2) <> 0 and m_agenda.frame(i,4) <> m_agenda.selected then agdOK = false
next
if agdOK = false then return

rideDetails.rec_ride.time = m_agenda.frame(m_agenda.index,0)
rideDetails.Updated = true
m_ride.time(m_ride.selected) = m_agenda.frame(m_agenda.index,0)

//update combined rides
var index as integer = m_agenda.selected + 1
var rec as new ride
var idx as integer = 1

while m_agenda.frame(index,3) <> 0

m_ride.time(m_agenda.frame(index,3)) = m_agenda.frame(m_agenda.index+idx,0)

rec = new ride(m_ride.ID(m_agenda.frame(index,3)))
rec.time = m_agenda.frame(m_agenda.index + idx,0)
rec.update

index = index + 1
idx = idx + 1
wend

m_agenda.selected = m_agenda.index
m_agenda.selectedRide = m_agenda.index

m_agenda.load
agenda.scroll.refresh

My guess from your code is that the exception is a NilObjectException and that it’s caused by one of m_agenda or m_ride being nil when this code runs.

If it’s a reproducible crash, run it in the debugger and it’ll show you exactly where the problem is.

Otherwise, you’ll need to use Introspection to find out what kind of exception it is (see the docs for introspection, there should be an example for App.unhandledException in there) and then add some guards and spammy logging to your code to see what could be wrong.

Until now I can’t reproduce this error. I am going to check Introspection.
Thanks for your reaction.