mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-16 21:58:25 +00:00
fix some uncaught error during runtime test
This commit is contained in:
parent
f9a50163c0
commit
eb39f360e3
1 changed files with 9 additions and 1 deletions
|
@ -87,7 +87,15 @@ impl WebsysDom {
|
|||
}
|
||||
});
|
||||
|
||||
let root = load_document().get_element_by_id(&cfg.rootname).unwrap();
|
||||
let document = load_document();
|
||||
let root = match document.get_element_by_id(&cfg.rootname) {
|
||||
Some(root) => root,
|
||||
// a match here in order to avoid some error during runtime browser test
|
||||
None => {
|
||||
let body = document.create_element("body").ok().unwrap();
|
||||
body
|
||||
}
|
||||
};
|
||||
|
||||
Self {
|
||||
interpreter: Interpreter::new(root.clone()),
|
||||
|
|
Loading…
Add table
Reference in a new issue