PrintComponent catch nonexistent component error

This commit is contained in:
2021-10-04 10:21:12 -06:00
parent a77b3f0155
commit ea409952ea

View File

@@ -194,7 +194,10 @@
(defCommand PrintComponent [entries (SelectedEntries null null)
componentType (Text null)]
(doFor e entries (ui.displayMessage (dictGet e.components componentType))) [])
(doFor e entries
(if (e.components.exists componentType)
(ui.displayMessage (dictGet e.components componentType))
(ui.displayMessage "Entry ${e.id} has no $componentType component"))) [])
(defCommand CreateEntry [name (Text null)]
[(archive.createEntry ->e