From 77923b443d1c7d173d4468a385221ce5b788fe2d Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Wed, 22 Apr 2020 23:08:04 +1000 Subject: [PATCH] Handle case when action id does not have number at end --- assets/javascripts/discourse/components/wizard-links.js.es6 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/components/wizard-links.js.es6 b/assets/javascripts/discourse/components/wizard-links.js.es6 index 308cd4bd..cd68847c 100644 --- a/assets/javascripts/discourse/components/wizard-links.js.es6 +++ b/assets/javascripts/discourse/components/wizard-links.js.es6 @@ -77,9 +77,10 @@ export default Component.extend({ let next = 1; if (items.length) { - next = Math.max.apply(Math, items.map((i) => { + next = Math.max.apply(Math, items.map((i) => { let parts = i.id.split('_'); - return parts[parts.length - 1]; + let lastPart = parts[parts.length - 1]; + return isNaN(lastPart) ? 0 : lastPart; })) + 1; }