Skip to content

Commit

Permalink
Merge branch 'master' into handle
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Nov 27, 2024
2 parents 611f274 + 85f4a6e commit dea81f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions VortexEngine/src/Menus/MenuList/PatternSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit dea81f1

Please sign in to comment.