From 1bc2749e1b412ba6f363d8c81f7d1775abb5f089 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Fri, 12 Feb 2021 04:54:36 +0900 Subject: [PATCH] Return when required element is not present --- plume-front/src/editor.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plume-front/src/editor.rs b/plume-front/src/editor.rs index 6df999e5..06e45cc4 100644 --- a/plume-front/src/editor.rs +++ b/plume-front/src/editor.rs @@ -365,7 +365,11 @@ fn init_editor() -> Result<(), EditorError> { .set_property("display", "block") .map_err(|_| EditorError::DOMError)?; // And hide the HTML-only fallback - let old_ed = document().get_element_by_id("plume-fallback-editor")?; + let old_ed = document().get_element_by_id("plume-fallback-editor"); + if old_ed.is_none() { + return Ok(()); + } + let old_ed = old_ed.unwrap(); let old_title = document().get_element_by_id("plume-editor-title")?; old_ed .dyn_ref::()