From 12de9a0ec9b2918b6d1fb77251ab35cd333d5a1e Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Sat, 31 Aug 2024 00:00:13 +0800 Subject: [PATCH] fix: crash of unfound size --- src/views/termwidgetpage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/termwidgetpage.cpp b/src/views/termwidgetpage.cpp index e12e3e8f1..d26adc3e1 100644 --- a/src/views/termwidgetpage.cpp +++ b/src/views/termwidgetpage.cpp @@ -169,16 +169,16 @@ void TermWidgetPage::split(Qt::Orientation orientation) // if there's no splitter, or the orientation is not correct, // create a new splitter, put the 2 terms into the splitter, // and replace the old term with the splitter. - QSplitter *newSplitter = createSubSplit(term, orientation); - if (splitter) { // see above splitter->insertWidget part to know why. QList sizes = splitter->sizes(); sizes.insert(index, sizes.at(index)); + QSplitter *newSplitter = createSubSplit(term, orientation); splitter->insertWidget(index, newSplitter); splitter->setSizes(sizes); setSplitStyle(splitter); } else { + QSplitter *newSplitter = createSubSplit(term, orientation); m_layout->insertWidget(index, newSplitter); } }