From fefe8f65d8d58c3d0a467520985350e82bc22e59 Mon Sep 17 00:00:00 2001 From: seternate Date: Sun, 5 May 2024 16:03:35 +0200 Subject: [PATCH] Fix empty command-line argument If no arguments where given an empty command-line argument was given to the game when being started. With this change no empty command-line argument will be given anymore. --- pkg/game/argument/argument.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/game/argument/argument.go b/pkg/game/argument/argument.go index 6af9d7a..b9837f0 100644 --- a/pkg/game/argument/argument.go +++ b/pkg/game/argument/argument.go @@ -214,7 +214,9 @@ func (arguments *Arguments) Parse() (args []string, err error) { tmpArguments = tmpArguments + tmpArg } } - args = strings.Split(tmpArguments, " ") + if len(tmpArguments) > 0 { + args = strings.Split(tmpArguments, " ") + } return }