mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-03 23:41:56 +00:00
Fix UI tests
Fixed a crash accessing a nullptr native window running UI tests from CLI.
Regression from 2e13559bbb
This commit is contained in:
parent
2e13559bbb
commit
890e27b0a1
@ -51,7 +51,10 @@ Display::Display(Display* parentDisplay,
|
|||||||
|
|
||||||
os::SurfaceRef Display::nativeSurface() const
|
os::SurfaceRef Display::nativeSurface() const
|
||||||
{
|
{
|
||||||
return base::AddRef(m_nativeWindow->surface());
|
if (m_nativeWindow)
|
||||||
|
return base::AddRef(m_nativeWindow->surface());
|
||||||
|
else
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Display::addLayer(const UILayerRef& layer)
|
void Display::addLayer(const UILayerRef& layer)
|
||||||
@ -76,6 +79,9 @@ void Display::removeLayer(const UILayerRef& layer)
|
|||||||
void Display::configureBackLayer()
|
void Display::configureBackLayer()
|
||||||
{
|
{
|
||||||
const os::SurfaceRef displaySurface = nativeSurface();
|
const os::SurfaceRef displaySurface = nativeSurface();
|
||||||
|
if (!displaySurface)
|
||||||
|
return;
|
||||||
|
|
||||||
UILayerRef layer = backLayer();
|
UILayerRef layer = backLayer();
|
||||||
|
|
||||||
os::SurfaceRef layerSurface = layer->surface();
|
os::SurfaceRef layerSurface = layer->surface();
|
||||||
|
Loading…
Reference in New Issue
Block a user