From bf818313f5ca417f5e4c750d634d8e09dffd8cc0 Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 16 Dec 2018 21:14:48 -0500 Subject: [PATCH] patch: fix for (#10) --- manipulatefragranceitems/HandleCollection.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manipulatefragranceitems/HandleCollection.go b/manipulatefragranceitems/HandleCollection.go index 4b99283..1abbdd6 100644 --- a/manipulatefragranceitems/HandleCollection.go +++ b/manipulatefragranceitems/HandleCollection.go @@ -78,6 +78,10 @@ func ManualUpdate() { // RemoveFromCollection takes the name of the fragrance to remove, removes it from the collection and then regenerated the json file func RemoveFromCollection() { currentCollection := ReadInCollection(MASTER) + if len(currentCollection.MasterCollection) == 0 { + fmt.Println("\nYour collection is empty.") + os.Exit(0) + } fmt.Println("Please type in the number of the fragrance you'd like to remove:") inputAsInt := ShowOptionsAndGetNumericInput(currentCollection) inputIndex := inputAsInt - 1