OpenToonz - An open-source full-featured 2D animation creation software
C
Keep selection valid when cutting frames
flurick91eb4ecb4c9c
diff --git a/toonz/sources/toonz/filmstripselection.cpp b/toonz/sources/toonz/filmstripselection.cppindex 1771c2870..0cf797899 100644--- a/toonz/sources/toonz/filmstripselection.cpp+++ b/toonz/sources/toonz/filmstripselection.cpp@@ -237,7 +237,10 @@ void TFilmstripSelection::cutFrames() {TXshSimpleLevel *sl = TApp::instance()->getCurrentLevel()->getSimpleLevel();if (sl) {int firstSelectedIndex = sl->fid2index(*m_selectedFrames.begin());- assert(firstSelectedIndex >= 0);+ if(firstSelectedIndex < 0 || firstSelectedIndex > sl->getFrameCount()) {+ selectNone();+ return;+ }FilmstripCmd::cut(sl, m_selectedFrames);selectNone();TFrameId fId = (firstSelectedIndex == 0)