window: fix missing surface null checks to prevent crashes (#9350)
This commit is contained in:
parent
8a6778f0a0
commit
868b2b544a
1 changed files with 4 additions and 1 deletions
|
|
@ -1730,7 +1730,10 @@ void CWindow::sendWindowSize(Vector2D size, bool force, std::optional<Vector2D>
|
||||||
}
|
}
|
||||||
|
|
||||||
NContentType::eContentType CWindow::getContentType() {
|
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) {
|
void CWindow::setContentType(NContentType::eContentType contentType) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue