diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-29 15:30:08 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-29 15:30:08 +0200 |
| commit | ae3d1ec3adccac586f90146b900b5f6af0199350 (patch) | |
| tree | b069d9ab4634578ebc4cebb95d1bd79f14fb6bfe /src/managers/XWaylandManager.cpp | |
| parent | ad4fc28f781e01c95e8fedc039451120f6c21250 (diff) | |
fix crash
Diffstat (limited to 'src/managers/XWaylandManager.cpp')
| -rw-r--r-- | src/managers/XWaylandManager.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index e588f21f..9bdd992b 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -51,18 +51,21 @@ void CHyprXWaylandManager::getGeometryForWindow(CWindow* pWindow, wlr_box* pbox) std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) { try { if (pWindow->m_bIsX11) { - if (pWindow->m_uSurface.xwayland) { + if (pWindow->m_uSurface.xwayland && pWindow->m_uSurface.xwayland->title) { return std::string(pWindow->m_uSurface.xwayland->title); } } else if (pWindow->m_uSurface.xdg) { - if (pWindow->m_uSurface.xdg->toplevel) { + if (pWindow->m_uSurface.xdg->toplevel && pWindow->m_uSurface.xdg->toplevel->title) { return std::string(pWindow->m_uSurface.xdg->toplevel->title); } } else { return ""; } - } catch (std::logic_error& e) { - Debug::log(ERR, "Error in getTitle: %s", e.what()); + } catch (std::exception& e) { + if (e.what()) + Debug::log(ERR, "Error in getTitle: %s", e.what()); + else + Debug::log(ERR, "Error in getTitle [e.what() nullptr]"); } return ""; |
