summaryrefslogtreecommitdiff
path: root/menu
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-04-14 18:58:37 +0200
committerewy <ewy0@protonmail.com>2026-04-14 18:58:37 +0200
commit370f13b58e9cb74eeab3461afb779cf4d013c94b (patch)
treeb030d70528cd390818254839c1f140a5a575f191 /menu
parent4fecdd952c270de8ce6e4cc4e6f3513e5579febe (diff)
handle not having stuff installed a little more gracefully
Diffstat (limited to 'menu')
-rw-r--r--menu/menu.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/menu/menu.go b/menu/menu.go
index 232a837..7f71e2d 100644
--- a/menu/menu.go
+++ b/menu/menu.go
@@ -8,8 +8,12 @@ import (
)
var WrongModelTypeError = errors.New("wrong model type")
+var NoSourcesIndexedError = errors.New("no sources indexed")
func Show(st *model.State, hydrators []model.Hydrator) (*model.HydratedSource, model.HydratedTarget, error) {
+ if len(st.Sources) == 0 {
+ return nil, nil, NoSourcesIndexedError
+ }
md := NewModel(st, hydrators)
program := tea.NewProgram(md)
resultModel, err := program.Run()