c90a3078c04e74947ce835349954332355933791

Author
outfoxxed <outfoxxed@outfoxxed.me>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

Replace a segfault with an error message

Diff

 1diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
 2index 3083004750dc6a3acd574cc3641bda3dd6b36ef9..bd12c42b0c95145d435031ad5fd97792d0619eda 100644
 3--- a/src/Hy3Layout.cpp
 4+++ b/src/Hy3Layout.cpp
 5@@ -545,7 +545,13 @@ void Hy3Layout::onWindowRemovedTiling(CWindow* window) {
 6 CWindow* Hy3Layout::getNextWindowCandidate(CWindow* window) {
 7 	auto* node = this->getWorkspaceRootGroup(window->m_iWorkspaceID);
 8 	if (node == nullptr) return nullptr;
 9-	while (node->data.type == Hy3NodeData::Group) node = node->data.as_group.lastFocusedChild;
10+	while (node->data.type == Hy3NodeData::Group) {
11+		node = node->data.as_group.lastFocusedChild;
12+		if (node == nullptr) {
13+			Debug::log(ERR, "A group's last focused child was null when getting the next selection candidate");
14+			return nullptr;
15+		}
16+	}
17 	return node->data.as_window;
18 }
19