summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <[email protected]>2018-03-07 23:00:24 -0500
committerKurt Hindenburg <[email protected]>2018-03-07 23:00:24 -0500
commitb85c469efc606f4777aabc62d637733959dfe664 (patch)
treeff8ca63d274907478e62670333ff05eadb012760
parentd2baabef754374c0acafc7f0c758d29a4a92f3cc (diff)
Check for valid session when detaching to prevent crashes
It is unclear what causes the session to be invalid when detaching tabs, but there are enough BRs with the same backtraces to confirm it. For now, check to prevent crashes. CCBUG: 390736
-rw-r--r--src/ViewManager.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp
index 36ab424..dd97650 100644
--- a/src/ViewManager.cpp
+++ b/src/ViewManager.cpp
@@ -374,7 +374,12 @@ void ViewManager::detachView(ViewContainer *container, QWidget *view)
return;
}
- emit viewDetached(_sessionMap[viewToDetach]);
+ // BR390736 - some instances are sending invalid session to viewDetached()
+ Session *sessionToDetach = _sessionMap[viewToDetach];
+ if (sessionToDetach == nullptr) {
+ return;
+ }
+ emit viewDetached(sessionToDetach);
_sessionMap.remove(viewToDetach);