Bug from nowWhere + Bug with 4.1.0

I tried my best to reproduce the error in playground but without success. Still getting this error randomly in our app when loading objects:

Uncaught TypeError: Cannot read property ‘0’ of undefined
at Effect…/Materials/effect.ts.Effect.getAttributeLocation (babylon.max.js:87400)
at Engine…/Engines/thinEngine.ts.ThinEngine._bindVertexBuffersAttributes (babylon.max.js:39409)
at Engine…/Engines/thinEngine.ts.ThinEngine.recordVertexArrayObject (babylon.max.js:39446)
at Geometry…/Meshes/geometry.ts.Geometry._bind (babylon.max.js:112331)
at Mesh…/Meshes/mesh.ts.Mesh._bind (babylon.max.js:115752)
at Mesh…/Meshes/mesh.ts.Mesh.render (babylon.max.js:116067)
at SubMesh…/Meshes/subMesh.ts.SubMesh.render (babylon.max.js:121533)
at RenderingGroup…/Rendering/renderingGroup.ts.RenderingGroup.renderUnsorted (babylon.max.js:161594)
at RenderingGroup…/Rendering/renderingGroup.ts.RenderingGroup.render (babylon.max.js:161495)
at RenderingManager…/Rendering/renderingManager.ts.RenderingManager.render (babylon.max.js:161856)

Our codebase is also to big to create a small example with this problem. :worried:
… i lookad a bit at the BabylonJs code. The problem is that at the time an effect gets rendered it happens that its this._attributes member is still undefined. That means the _prepareEffect() function wasn’t finished but the effect counts as isReady already.
If you take a look at the _isReadyInternal() function here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/effect.ts#L303
you will see that the effect relies on the ready state of the _pipelineContext if the effect itself is not ready yet. Theoretically it could happen that the _pipelineContext says that it is ready but the compile callback inside _prepareEffect() didn`t get executed yet: https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/effect.ts#L545
does that make sense? :dizzy_face: