NullReferenceException: Object reference not set to an instance of an object.
Hi all,
What's the best way to troubleshoot an error like this?
Thanks,
Aaron
It's a long one but the log are here:
Warn 06/16/2023 11:27:02 TaskScheduler.UnobservedTaskException:
System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object.
at VertiGIS.Mobile.Modules.Highlights.HighlightService.RefreshFeaturesInOverlays(IMapViewProxy, IEnumerable`1, HighlightService.GraphicsType) + 0x498
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<>c__DisplayClass45_0.<<RefreshHighlightsAsync>b__0>d.MoveNext() + 0xce
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Infrastructure.Maps.MapCommandRunner.<ExecuteOnAllMapsAsync>d__20.MoveNext() + 0x234
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Infrastructure.Maps.MapCommandRunner.<RunAsync>d__13.MoveNext() + 0x2e4
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<RefreshHighlightsAsync>d__45.MoveNext() + 0xfe
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<>c__DisplayClass73_0.<<FeatureUpdatedAsync>b__0>d.MoveNext() + 0xfb
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Toolkit.Utilities.ThreadHelper.<>c__DisplayClass3_0.<<RunOnMainThreadAsync>b__0>d.MoveNext() + 0x149
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<FeatureUpdatedAsync>d__73.MoveNext() + 0xe6
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
at VertiGIS.Mobile.Modules.Highlights.HighlightService.RefreshFeaturesInOverlays(IMapViewProxy, IEnumerable`1, HighlightService.GraphicsType) + 0x498
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<>c__DisplayClass45_0.<<RefreshHighlightsAsync>b__0>d.MoveNext() + 0xce
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Infrastructure.Maps.MapCommandRunner.<ExecuteOnAllMapsAsync>d__20.MoveNext() + 0x234
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Infrastructure.Maps.MapCommandRunner.<RunAsync>d__13.MoveNext() + 0x2e4
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<RefreshHighlightsAsync>d__45.MoveNext() + 0xfe
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<>c__DisplayClass73_0.<<FeatureUpdatedAsync>b__0>d.MoveNext() + 0xfb
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Toolkit.Utilities.ThreadHelper.<>c__DisplayClass3_0.<<RunOnMainThreadAsync>b__0>d.MoveNext() + 0x149
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<FeatureUpdatedAsync>d__73.MoveNext() + 0xe6
<---
System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object.
at VertiGIS.Mobile.Modules.Highlights.HighlightService.RefreshFeaturesInOverlays(IMapViewProxy, IEnumerable`1, HighlightService.GraphicsType) + 0x498
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<>c__DisplayClass45_0.<<RefreshHighlightsAsync>b__0>d.MoveNext() + 0xce
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Infrastructure.Maps.MapCommandRunner.<ExecuteOnAllMapsAsync>d__20.MoveNext() + 0x234
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Infrastructure.Maps.MapCommandRunner.<RunAsync>d__13.MoveNext() + 0x2e4
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<RefreshHighlightsAsync>d__45.MoveNext() + 0xfe
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<>c__DisplayClass73_0.<<FeatureUpdatedAsync>b__0>d.MoveNext() + 0xfb
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Toolkit.Utilities.ThreadHelper.<>c__DisplayClass3_0.<<RunOnMainThreadAsync>b__0>d.MoveNext() + 0x149
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<FeatureUpdatedAsync>d__73.MoveNext() + 0xe6
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
at VertiGIS.Mobile.Modules.Highlights.HighlightService.RefreshFeaturesInOverlays(IMapViewProxy, IEnumerable`1, HighlightService.GraphicsType) + 0x498
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<>c__DisplayClass45_0.<<RefreshHighlightsAsync>b__0>d.MoveNext() + 0xce
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Infrastructure.Maps.MapCommandRunner.<ExecuteOnAllMapsAsync>d__20.MoveNext() + 0x234
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Infrastructure.Maps.MapCommandRunner.<RunAsync>d__13.MoveNext() + 0x2e4
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<RefreshHighlightsAsync>d__45.MoveNext() + 0xfe
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<>c__DisplayClass73_0.<<FeatureUpdatedAsync>b__0>d.MoveNext() + 0xfb
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Toolkit.Utilities.ThreadHelper.<>c__DisplayClass3_0.<<RunOnMainThreadAsync>b__0>d.MoveNext() + 0x149
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
at VertiGIS.Mobile.Modules.Highlights.HighlightService.<FeatureUpdatedAsync>d__73.MoveNext() + 0xe6
<---
I
-
This error means an variable pointing to an object is empty
I see a RefreshFeaturesInOverlays method, it seems the issue is in the data.1 -
Use the developer console with the Workflow debugger, and like Nico said you have an null input. It will probably be the last activity logged, depending of course on the structure of your WF.
0 -
Hi Nico and Zack,
Thank you for the suggestions. I am aware that it's pointed to a null input but I am scratching my head trying to find which one is the null input.
I'm using the debug log level on mobile, and the message above is the most detailed debug info I can retrieve..
Thanks,
Aaron
0 -
If you've gotten into the logger then you're almost there!
What Nico and I are saying is that you need to check the inputs to the last activity which ran to look for nulls, not the stack trace of the error. Watch the tech tip video "How to debug workflows in Geocortex Mobile" which happens to do precisely that
In the video, the input argument to the activity is itself null, but you could have a null property of an object which exists. A totally random example off the top of my head for something that might cause such an error would be trying to highlight a FeatureSet which results from a query without geometries, in which case you might need to update the Query activity to return those geometries..
0 -
Hi Zack,
The link links to the ESRI partner awards page. But does the error show up from the last activity ran?
The workflow goes update features then if the update succeeded, an alert will fire saying update successful and that's the end of the workflow. The Null reference error shows up after the alert was fired.
Thanks,
Aaron
0 -
Oh no, grabbed the wrong link! Here it is: https://vertigisstudio.com/how-to-debug-workflows-in-geocortex-mobile-geocortex-tech-tip/
If the error comes from the app itself, and not Workflow, then you might be barking up the wrong tree here. In that case, you might just check that your uploaded features include all necessary fields (including and particularly geometry) but if they look all good then this may be an issue with either how you're calling the WF or a bug in the Mobile app itself. In either of those cases, I'd recommend opening a Support ticket but you can dig around in the Mobile SDK yourself to see what the RefreshFeaturesInOverlays function requires which might not be getting met in your case.
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
6 kommentarer