mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:18:12 +00:00
LibJS+LibWeb: Remove NonnullGCPtr<T>::operator=(GCPtr<T>) footgun
GCPtr can be null so it's not safe to assign it to a NonnullGCPtr unless you know it to be non-null. This exposed a number of wrong uses in LibWeb which had to be fixed as part of this change.
This commit is contained in:
parent
4abdb68655
commit
d5ed07fdc4
5 changed files with 32 additions and 39 deletions
|
@ -285,7 +285,7 @@ bool EventDispatcher::dispatch(JS::NonnullGCPtr<EventTarget> target, Event& even
|
|||
}
|
||||
// 8. Otherwise, set target to parent and then:
|
||||
else {
|
||||
target = parent;
|
||||
target = *parent;
|
||||
|
||||
// 1. If isActivationEvent is true, activationTarget is null, and target has activation behavior, then set activationTarget to target.
|
||||
if (is_activation_event && !activation_target && target->activation_behavior)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue