Exception of class NiObjectException was not handled

How to identify the class NilObjectException? Isn’t this a built-in class?
Tim

nil means you have a variable with class xy defined but not created an object.
var x as new Class1 is not nil
var y as Class1 it is nil / null
propertys from kind class/object are also by default nil

https://docs.xojo.com/UserGuide:Exception_Handling
https://docs.xojo.com/NilObjectException

Yes, NilObjectException is a subclass of a RuntimeException.
You can identify it like this:

if MyObject isa NilObjectException then

One usual error is to declare a class and not instantiating it.
It raises such exception at some point when you try to use its nonexistent contents.

Var d As New Date
Messagebox d.LongDate   // Works

Var d As Date           // Just declared it and forgot to instantiate it
Messagebox d.LongDate   // Nil exception

In a debug session you can find it.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.