diff options
| author | nyx <nnyyxxxx@protonmail.com> | 2025-02-06 06:16:47 -0500 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2025-02-06 11:17:12 +0000 |
| commit | 868b2b544abb61764089b0e4e9b0fd153a9db26f (patch) | |
| tree | 1586403ce399654ffecaa008acd15bad53de5166 /src/desktop/Window.cpp | |
| parent | 8a6778f0a087cdfc4bc1d3751b0be2c2bf3322aa (diff) | |
window: fix missing surface null checks to prevent crashes (#9350)
Diffstat (limited to 'src/desktop/Window.cpp')
| -rw-r--r-- | src/desktop/Window.cpp | 5 |
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) { |
