As I told you a couple of weeks ago in
this thread, your getStreamId function was unconditionally adding an empty string to the array, even when it failed, which didn't seem right to me. You've since deleted the code from that post so no one can see what it's doing. But as I said there, you need to decide if you really want the error case to return an array containing one element, or an empty array. If you really want it to contain one element (which seems strange to me and likely to cause other problems later, but that's your choice), then the way to test it would be:
if IDArray.count() = 1 and IDArray[0] = ""
--Mark