Fix some crashes on invalid ids

This commit is contained in:
Oskari Alaranta 2026-02-21 03:40:39 +02:00
parent 631770725b
commit 572a0b6bd5
1 changed files with 3 additions and 5 deletions

View File

@ -1501,6 +1501,7 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
dprintln("DestroyWinow"); dprintln("DestroyWinow");
dprintln(" window: {}", wid); dprintln(" window: {}", wid);
(void)TRY_REF(get_window(wid));
TRY(destroy_window(client_info, wid)); TRY(destroy_window(client_info, wid));
break; break;
@ -2452,12 +2453,9 @@ BAN::ErrorOr<void> handle_packet(Client& client_info, BAN::ConstByteSpan packet)
dprintln("FreePixmap"); dprintln("FreePixmap");
dprintln(" pixmap: {}", pid); dprintln(" pixmap: {}", pid);
auto it = g_objects.find(pid); (void)TRY_REF(get_pixmap(pid));
ASSERT(it != g_objects.end());
ASSERT(it->value->type == Object::Type::Pixmap);
client_info.objects.remove(pid); client_info.objects.remove(pid);
g_objects.remove(it); g_objects.remove(pid);
break; break;
} }