Strange NilObjectException error

  1. 2 months ago

    Hi -

    I've gotten a report from a user of one of my apps about errors and this is what was report to me -

    NilObjectException -- Window1.Window1.CheckBIO%b%o<Window1.Window1>s
    Window1.Window1.LoadOtherDev%%o<Window1.Window1>
    SettingsWin.SettingsWin.Savebtn_Action%%o<SettingsWin.SettingsWin>o<PushButton>
    Delegate.IM_Invoke%%o<PushButton>
    _os_activity_initiate.......RuntimeRun
    REALbasic._RuntimeRun
    _Main
    main

    User said got the same erro on Mac OS 10.11 & 10.14. Also said tried my app on 10.9 and it just crashes.

    Seems a NilObjectException error but I'm not sure were or why. I've only had one person report this error and my app works for most people.
    I've been unable to recreate this error.

    Thanks.

  2. Sascha S

    Feb 9 Pre-Release Testers, Xojo Pro Germany
    Edited 2 months ago

    Maybe Window1 or CheckBio was non existent?

  3. Olivier C

    Feb 9 Pre-Release Testers, Xojo Pro Europe (Belgium, Brussels)

    Do you have AddHandler for an event in Window1 ?
    Could be that when the event occurs the Window1.method is called but Window1 is closed ...

  4. Window1 is always open. SettingsWin is a sheet window.

    I'm a bit puzzled.

  5. Derk J

    Feb 9 Pre-Release Testers, Xojo Pro

    Do you have a method called checkbio?

  6. Yes, there is a method called CheckBio.

  7. Jürg O

    Feb 9 Pre-Release Testers, Xojo Pro
    Edited 2 months ago

    An example: The Method untitled contains the code if someFolderItem.exists then. But... the Property someFolderItem is NIL. And that obviously causes a NilObjectException.
    This is the stack you get in App.UnhandledException:

    RuntimeRaiseException
    RaiseNilObjectException
    Window1.Window1.Untitled%%o<Window1.Window1>
    Window1.Window1.PushButton1_Action%%o<Window1.Window1>o<PushButton>

    The stack doesn't tell you which property has caused the NilObjectException. All you can read from this example is that it occured in Method 'Untitled'.

    So you're looking at a NilObjectException that occured in your method 'CheckBio'.

  8. I see. Well now I got to figure out whats causing it in that method and why only one person has had this issue.

    Thanks for all the help!

or Sign Up to reply!