How to un-nil an array?

Something must have changed for Xojo2015r4… As result of a function an array may become nil:

TrashMailboxes = theGetter.getTrashMailboxes

Some lines of code later I want to add some data to the array. But when the array has become nil how do I do that? Both append and redim give me a NOE. Any ideas?

I could check the the result of the function before assigning it to the array. But this seems to be an awful kludge. And somehow I should be able to un-nil this array. Especially as this may not be the only place for such a situation.

This has been possible for a long time and nothing’s changed in 2015r4. It can occur when a function explicitly returns Nil or implicitly returns Nil due to reaching the exit without a Return statement.

You can create a non-Nil array by having a temporary local variable and assigning it to your destination variable.

Thanks for the info, Joe.