mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 23:23: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;
|
var s: ?*String = undefined;
|
||||||
const err = c._dom_event_get_type(evt, &s);
|
const err = c._dom_event_get_type(evt, &s);
|
||||||
try DOMErr(err);
|
try DOMErr(err);
|
||||||
|
|
||||||
|
// if the event type is null, return a empty string.
|
||||||
|
if (s == null) return "";
|
||||||
|
|
||||||
return strToData(s.?);
|
return strToData(s.?);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user