mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
dom: an event type can be null
In this case we return empty string
This commit is contained in:
@@ -397,6 +397,10 @@ pub fn eventType(evt: *Event) ![]const u8 {
|
||||
var s: ?*String = undefined;
|
||||
const err = c._dom_event_get_type(evt, &s);
|
||||
try DOMErr(err);
|
||||
|
||||
// if the event type is null, return a empty string.
|
||||
if (s == null) return "";
|
||||
|
||||
return strToData(s.?);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user