mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
The database map stores GC::Weak<Database> entries. When the GC collects a Database, the weak pointer goes null but the map entry remains. The old code dereferenced the weak pointer without checking liveness, causing a null reference binding (UBSan). Fix this by checking ptr() before dereferencing, and cleaning up the stale map entry if the database was collected.