From cd2019332e76e0795ef5ac62557d1632df048aed Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Tue, 14 May 2024 09:08:09 +0200 Subject: [PATCH] feat: add check for files with 'AnalyseBereichEditor' --- src/model/onkostar_editor.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/model/onkostar_editor.rs b/src/model/onkostar_editor.rs index f76d5de..ed13005 100644 --- a/src/model/onkostar_editor.rs +++ b/src/model/onkostar_editor.rs @@ -404,6 +404,16 @@ impl FromStr for OnkostarEditor { type Err = String; fn from_str(s: &str) -> Result { + if !s + .matches("") + .collect::() + .is_empty() + { + return Err( + "Datei mit Inhalt 'AnalyseBereichEditor' kann nicht verwendet werden".into(), + ); + } + match from_str::(s) { Ok(profile) => Ok(profile), Err(err) => Err(err.to_string()),