From d42cb7b7908a4787e40811a7f343b8e74a8a21f8 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Thu, 6 Jun 2019 09:20:57 -0400 Subject: [PATCH] Fix issue where iD could crash upon save if user had edits stored before iD 2.15 (close #6496) --- modules/core/history.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/core/history.js b/modules/core/history.js index 518cba0a6..acb0d97d5 100644 --- a/modules/core/history.js +++ b/modules/core/history.js @@ -323,9 +323,11 @@ export function coreHistory(context) { } else { var s = new Set(); _stack.slice(1, _index + 1).forEach(function(state) { - state.photoOverlaysUsed.forEach(function(photoOverlay) { - s.add(photoOverlay); - }); + if (state.photoOverlaysUsed && Array.isArray(state.photoOverlaysUsed)) { + state.photoOverlaysUsed.forEach(function(photoOverlay) { + s.add(photoOverlay); + }); + } }); return Array.from(s); }