Change historyOfTypeIsValid condition

This commit is contained in:
Damien Duhamel
2017-12-07 10:14:39 +01:00
committed by Shawn Erquhart
parent 9e5f42e772
commit fba6929301

View File

@ -21,7 +21,8 @@ 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[0].type !== 'set_selection' ); || (next && next.length > 1)
|| (next && next[0] && next[0].type !== 'set_selection');
if (historyOfTypeIsValid) { if (historyOfTypeIsValid) {
change[type](); change[type]();