summaryrefslogtreecommitdiff
path: root/src/desktop/Window.cpp
diff options
context:
space:
mode:
authornyx <nnyyxxxx@protonmail.com>2025-02-06 06:16:47 -0500
committervaxerski <vaxry@vaxry.net>2025-02-06 11:17:12 +0000
commit868b2b544abb61764089b0e4e9b0fd153a9db26f (patch)
tree1586403ce399654ffecaa008acd15bad53de5166 /src/desktop/Window.cpp
parent8a6778f0a087cdfc4bc1d3751b0be2c2bf3322aa (diff)
window: fix missing surface null checks to prevent crashes (#9350)
Diffstat (limited to 'src/desktop/Window.cpp')
-rw-r--r--src/desktop/Window.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp
index c71fe652..b5126b67 100644
--- a/src/desktop/Window.cpp
+++ b/src/desktop/Window.cpp
@@ -1730,7 +1730,10 @@ void CWindow::sendWindowSize(Vector2D size, bool force, std::optional<Vector2D>
}
NContentType::eContentType CWindow::getContentType() {
- return m_pWLSurface->resource()->contentType.valid() ? m_pWLSurface->resource()->contentType->value : CONTENT_TYPE_NONE;
+ if (!m_pWLSurface || !m_pWLSurface->resource() || !m_pWLSurface->resource()->contentType.valid())
+ return CONTENT_TYPE_NONE;
+
+ return m_pWLSurface->resource()->contentType->value;
}
void CWindow::setContentType(NContentType::eContentType contentType) {