Safari Error when assigning layer

Hi, in CHrome (Mac and PC) I use the following code without error:

this.myLayer= this.app.scene.layers.getLayerByName('myLayer');
myEntity.render.layers = [this.myLayer.id];

…but in Safarai on Mac I get the following error in the console:

TypeError: undefined is not an object (evaluating 'rhs.r)

The game continues to run but I have an Error Loading Scripts. Open the browser console… in the game window.

Does anyone know what might be going on or how to fix it.
Thanks

You likely have a call-stack associated with the error? Inspect it and see what fails - ideally with the debug engine to have more readable code.

It seems that it had lost a reference to a couple of variables. Very strange.

Once I explicitly declared them again right before the code, it worked fine on safari.

odd