od <> nil crashes on "cancel".

I show a OpenDialog to select a file and when I click the “cancel” button on the dialog, my app crashes, because it proceeds to complete the method I’ve designated it to do if the OpenDialog <> nil.

[code]
If BmgOpen <> Nil Then
BmgDecoder.ReadBmgMessage //Still proceeds if “cancel” is pressed.
Else

End If[/code]

Project: https://www.dropbox.com/s/1q4u7vx1df2a1bk/XojoForum.xojo_binary_project
(I renamed the project to “XojoForum” so I could continue working on the original file.)

Thanks,
Shane.

Test the returned FolderItem for Nil, not the dialog:

' from MessageTool.FileOpen in your project: TheFile = BmgOpen.ShowModal() If TheFile <> Nil Then App.BmgFile = TheFile BmgDecoder.ReadBmgMessage Else