What does this error mean ?

Hi guys im getting this error when im switching a scene. I did check if it was sceneGroup.insert(object) as corona was suggesting but its actually sceneGroup:insert(object)

here is the line of code that gives me this error 

[lua] sceneGroup:insert(tick1) [/lua]

is tick1 nil?

no , 

[lua] local tick = widget.newButton

{

  top = 22.5,

  left = 142,

  width = 25,

  height = 25,

  defaultFile = (“Sfondi/icons/tick.png”),

  overFile = (“Sfondi/icons/tick.png”),

  onEvent = handleButtonEventTick 

 }  [/lua]

Well, that’s lovely but doesn’t mean it isn’t nil, could you check?

EDIT: In fact, you’re inserting tick1 but that object is called tick…but I’m guessing another typo…?

Put ‘print(tick1)’ before the insert line.

Although I seem to remember your console doesn’t work? Is that still the case? If so you’re basically trying to fly a plane blind.

  if tick ~= nil then   sceneGroup:insert(tick) end  

If the above code works, then tick is nil and you need to find out why.

oh fairs, now it works. Why is it nil tho haha 

Well, firstly, did you mean tick or tick1 in your initial post? 

Secondly, it doesn’t really ‘work’. You’re just avoiding a runtime error by doing nothing if it is nil. Sometimes that is ok if an object can indeed be nil in certain circumstances, but I suggest not in this case.

Track through everything that happens to ‘tick’ or ‘tick1’ or whatever it is, from the time it is created to the time you try to insert it. Check whether it’s nil right after creation, which would suggest the image doesn’t exist. 

okay got it, thank you as always