Running this code causes my app to close / crash?

local function listener(event)     local url = event.url     print("url", url)     if(string.find(url, "corona:close") ~= nil) then              elseif(string.find(url, "corona:money") ~= nil) then              elseif event.errorCode then         print( "Error: " .. tostring( event.errorMessage ) )     end     closetore()     return false end native.showWebPopup(10, 75, 460, 650, "MY\_URL", { hasBackground=false, urlRequest=listener })

For some reason when ever I make a call to the code above my app closes without any errors in logcat.

EDIT: I pin pointed it to the listener. I’m not sure what’s causing it but when I remove the listener part everything works fine. Any help on what I should be looking at?

I figured it out

In the  closestore() function I was calling code to close the webpopup but it was already being closed so I guess it would cause the app to crash.

I figured it out

In the  closestore() function I was calling code to close the webpopup but it was already being closed so I guess it would cause the app to crash.