I just noticed a strange behavior of pcall function. I often create display objects and then remove them. Due to delays I have to do a nil check and in 99% of cases it works wonderfully:
if object ~= nil then
object:removeSelf()
end
But sometimes, especially on physical devices, removeSelf() gives an error that the object is still nil! So, I decided to use remove-lines in a pcall-wrap… Guess what:
pcall(object:removeSelf()) works only in main.lua, but if it is situated in any of the scenes, then it gives an error. Check it for yourself. I guess it is a bug.