From 0b1f545aa58c2cb629daf77cce3979c5fee2b7d9 Mon Sep 17 00:00:00 2001 From: Darko Luketic Date: Sat, 2 Dec 2023 00:04:04 +0100 Subject: [PATCH] checked if logs ID is empty --- cmd/logs.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/logs.go b/cmd/logs.go index d20c085..4284376 100644 --- a/cmd/logs.go +++ b/cmd/logs.go @@ -2,6 +2,7 @@ package cmd import ( "context" + "errors" "fmt" "runtime" @@ -24,6 +25,9 @@ var logsCmd = &cobra.Command{ Short: "Show logs of a project", RunE: func(cmd *cobra.Command, args []string) error { runtime.GOMAXPROCS(1) + if showLogID == -1 { + return errors.New("ID can not be empty") + } client, err := ent.Open("sqlite3", fmt.Sprintf("file:%s?mode=rwc&cache=private&_fk=1", sqliteFilename)) if err != nil { return fmt.Errorf("failed opening connection to sqlite: %v", err)