From 62ce1bd9e719656d5005e3895ccb6e75c8e7ce23 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Tue, 8 Feb 2022 13:29:27 +0900 Subject: [PATCH] Assert that XDG_RUNTIME_DIR is set if used --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index 8bcfc26..54353a1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -290,6 +290,7 @@ fn main() -> Result<(), String> { prefix_dir = opt.alternate_prefix_dir.clone(); } else { prefix_dir = var("XDG_RUNTIME_DIR").map_err(|e| format!("{}", e))?; + assert!(!prefix_dir.is_empty(), "XDG_RUNTIME_DIR is not set"); } let mut send_total_path = PathBuf::new();