From 1c2783c09fadd7a07bad9fac960131e8ab84b526 Mon Sep 17 00:00:00 2001 From: ams-hash Date: Sat, 6 Nov 2021 18:56:41 +0000 Subject: [PATCH] Fixed bug where it crashed if no input was entered --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index 16f716a..713e9a4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,6 +22,10 @@ fn main() { let mut previous_command = None; while let Some(command) = commands.next() { + if command.is_empty() { + continue; + } + // everything after the first whitespace character is interpreted as args to the command let mut parts = command.trim().split_whitespace(); let command = parts.next().unwrap();