desktop/reserved: fix a possible reserved crash (#13207)

This commit is contained in:
Vaxry 2026-02-10 14:59:21 +00:00 committed by GitHub
parent ff061d177e
commit 339661229d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View file

@ -16,7 +16,8 @@ CReservedArea::CReservedArea(double top, double right, double bottom, double lef
}
CReservedArea::CReservedArea(const CBox& parent, const CBox& child) {
ASSERT(!parent.empty() && !child.empty());
if (parent.empty() || child.empty())
return; // empty reserved area
ASSERT(parent.containsPoint(child.pos() + Vector2D{0.0001, 0.0001}));
ASSERT(parent.containsPoint(child.pos() + child.size() - Vector2D{0.0001, 0.0001}));