Error on console when gallery is empty

I have some other page where there is a gallery which is connect to a gallery field in db. If the db field is empty, there is this error you can see on the console:

It is kind of slows down the page loading.

Can somebody please check it? Thanks!

Failed setting items: TypeError: Cannot read property ‘length’ of undefined
at Native.set items [as items] (wixCodeApi.js:163)
at eval (setValueToComponent.js:11)
at Array.reduce ()
at eval (setValueToComponent.js:7)
at e.exports (setValueToComponent.js:22)
at eval (defaultAdapter.js:170)
at lodash.min.js:46
at mt (lodash.min.js:27)
at lodash.min.js:45
at nu (lodash.min.js:67)
at P (defaultAdapter.js:150)
at Object.recordSetLoaded (defaultAdapter.js:227)
at eval (adapterApi.js:155)
at Array.map ()
at Object.recordSetLoaded (adapterApi.js:154)
at e.exports (initAdapters.js:3)
at eval (controller.js:527)
at c (runtime.js:63)
at Generator.eval [as _invoke] (runtime.js:293)
at Generator.eval [as next] (runtime.js:118)
at i (controllerStore.js:43)
at u (controllerStore.js:43)
at eval (controllerStore.js:43)
at new Promise ()
at eval (controllerStore.js:43)
at n (immediate.js:5)
at Object.then (immediate.js:13)
at eval (controller.js:513)
at c (runtime.js:63)
at Generator.eval [as _invoke] (runtime.js:293)
at Generator.eval [as next] (runtime.js:118)
at i (controllerStore.js:43)
at u (controllerStore.js:43)

Can’t find where this is.

I mean, load the page (on live site) and check out console on developer tools

@buyhoodbiz And is this causing a problem? From what I see everything works OK.

On other pages, sometimes it breaks the onReady. It is really a quick fix…

@buyhoodbiz What do you mean that “it breaks the onReady”?

Sorry, I see that it won’t break it now… Before your last improvements, the gallery would start loading before the page’s onReady method (as far as I could see in logs). And in cases when the gallery was empty it would cause failure of the onReady. For instance, I would manipulate some elements in code and it wouldn’t happen. And on pages where the gallery was not empty - it would never happen. As far as I can see everything works, but there are also logs in developer tools, something to do with your new structure like this:
“Wix setHeight called with height less than 0”
And it feels that the page loads slower than pages with images. Like this one, for example: