diff --git a/src/rnote/notes.rs b/src/rnote/notes.rs index 5fc4743..18bfe14 100644 --- a/src/rnote/notes.rs +++ b/src/rnote/notes.rs @@ -278,6 +278,9 @@ pub fn show_all() -> Result<()> { files.push(fs::read_to_string(file.path())?); } } + if files.is_empty() { + return Err(anyhow!("No notes found.")); + } let skin = show::make_skin(); let md = &files.join("---\n"); show::run_app(skin, md)?; @@ -313,6 +316,9 @@ pub fn show_category(category: &str) -> Result<()> { files.push(fs::read_to_string(file.path())?); } } + if files.is_empty() { + return Err(anyhow!("No notes found.")); + } let skin = show::make_skin(); let md = &files.join("---\n"); show::run_app(skin, md)?;