fix(Workspaces): check thread is running before parse response

This commit is contained in:
Alexis 2019-01-13 22:23:09 +01:00
parent 171e0e5ae3
commit f8116132a7
1 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,9 @@ void waybar::modules::sway::Workspaces::worker()
{
std::lock_guard<std::mutex> lock(mutex_);
auto res = ipc_.sendCmd(IPC_GET_WORKSPACES);
workspaces_ = parser_.parse(res.payload);
if (thread_.isRunning()) {
workspaces_ = parser_.parse(res.payload);
}
}
dp.emit();
} catch (const std::exception& e) {