summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2018-06-01 11:38:44 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2018-06-01 11:37:26 +0000
commit52e69f91b631d4fa0aae135dea8bc7bad277cbd7 (patch)
treef70be7fd6f5385b5a067c37deddc371486aece43
parentd457fb5984dda63399474e5573ae720b7cbf56c5 (diff)
Fix crash when the return-from-master slide is deleted while in master
Need to check for slide validity before attempting to change to it. Task-number: QT3DS-1750 Change-Id: I77e93f8f8398169dd9ebf54a8fb281b16407d055 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/Authoring/Studio/Palettes/Slide/SlideView.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp
index 6f82ef9b..47fb154b 100644
--- a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp
+++ b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp
@@ -93,11 +93,11 @@ void SlideView::setShowMasterSlide(bool show)
theBridge->GetOrCreateGraphRoot(theRoot); // this will return the master slide
qt3dsdm::ISlideSystem *theSlideSystem = theDoc->GetStudioSystem()->GetSlideSystem();
if (m_CurrentModel != m_MasterSlideModel) {
- if (m_MasterSlideReturnPointers.contains(theNewActiveSlide)) {
- theNewActiveSlide = m_MasterSlideReturnPointers.value(theNewActiveSlide);
- } else {
+ qt3dsdm::Qt3DSDMSlideHandle masterSlide = theNewActiveSlide;
+ theNewActiveSlide = m_MasterSlideReturnPointers.value(masterSlide, 0);
+ if (!theSlideSystem->SlideValid(theNewActiveSlide)) {
theNewActiveSlide = theSlideSystem->GetSlideByIndex(
- theNewActiveSlide, 1); // activate the first slide;
+ masterSlide, 1); // activate the first slide;
}
}