From 85f4a6efd1518f17c50947523df0c03daa26a030 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 26 Nov 2024 17:20:35 -0800 Subject: [PATCH] Fixed pattern select --- VortexEngine/src/Menus/MenuList/PatternSelect.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/VortexEngine/src/Menus/MenuList/PatternSelect.cpp b/VortexEngine/src/Menus/MenuList/PatternSelect.cpp index 79720ebf56..b30f2b80d8 100644 --- a/VortexEngine/src/Menus/MenuList/PatternSelect.cpp +++ b/VortexEngine/src/Menus/MenuList/PatternSelect.cpp @@ -59,7 +59,7 @@ void PatternSelect::onShortClick() bool doSkip = g_pButton->onConsecutivePresses(2); MAP_FOREACH_LED(m_targetLeds) { Pattern *pat = m_previewMode.getPattern(pos); - if (pat->getNumArgs() <= m_argIndex) { + if (!pat || pat->getNumArgs() <= m_argIndex) { continue; } uint8_t &arg = pat->argRef(m_argIndex); @@ -152,7 +152,8 @@ void PatternSelect::onLongClick() } Leds::holdAll(m_menuColor); } - needsSave = !Modes::curMode()->equals(&m_previewMode); + Mode *cur = Modes::curMode(); + needsSave = !cur->equals(&m_previewMode); if (needsSave) { // update the current mode with the new pattern Modes::updateCurMode(&m_previewMode);