From 365d12c18511a70acc2bf5488529ff7b377ac915 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 13 May 2019 16:53:44 +0300 Subject: [PATCH] check presence of overlap[i] --- apps/block_scout_web/assets/js/lib/list_morph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/block_scout_web/assets/js/lib/list_morph.js b/apps/block_scout_web/assets/js/lib/list_morph.js index 4f3b0736c4..175acb7c3f 100644 --- a/apps/block_scout_web/assets/js/lib/list_morph.js +++ b/apps/block_scout_web/assets/js/lib/list_morph.js @@ -42,8 +42,8 @@ export default function (container, newElements, { key, horizontal } = {}) { // update kept items currentList = currentList.map(({ el }, i) => ({ - id: overlap[i].id, - el: el.outerHTML === overlap[i].el.outerHTML ? el : morph(el, overlap[i].el) + id: overlap[i] && overlap[i].id, + el: el.outerHTML === overlap[i] && overlap[i].el && overlap[i].el.outerHTML ? el : morph(el, overlap[i].el) })) // add new items