Skip to content

Commit

Permalink
fix:the workspace data is null in a small probability
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamMaoMao committed Dec 23, 2023
1 parent d2767fb commit 26b1a64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/hyprland/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ auto Workspaces::update() -> void {
// add workspaces that wait to be created
unsigned int currentCreateWorkspaceNum = 0;
for (Json::Value const &workspaceToCreate : m_workspacesToCreate) {
createWorkspace(workspaceToCreate);
if (workspaceToCreate.isMember("name")) { //the data is ready
createWorkspace(workspaceToCreate);
} else {
break;
}
currentCreateWorkspaceNum++;
}
for (unsigned int i = 0; i < currentCreateWorkspaceNum; i++) {
Expand Down

0 comments on commit 26b1a64

Please sign in to comment.