Check next in condition

This commit is contained in:
Damien Duhamel 2017-12-07 10:18:40 +01:00 committed by Shawn Erquhart
parent fba6929301
commit 99ee5e2f9a

View File

@ -22,9 +22,9 @@ function changeHistory(change, type) {
const next = historyOfType.first(); const next = historyOfType.first();
const historyOfTypeIsValid = historyOfType.size > 1 const historyOfTypeIsValid = historyOfType.size > 1
|| (next && next.length > 1) || (next && next.length > 1)
|| (next && next[0] && next[0].type !== 'set_selection'); || (next && next[0] && next[0].type !== 'set_selection';
if (historyOfTypeIsValid) { if (next && historyOfTypeIsValid) {
change[type](); change[type]();
} }