From 6225e142525d02888d0a1aa83fb716ddb58db907 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Wed, 9 Feb 2022 09:13:19 -0600 Subject: more robust install-app --- lazybones-hunchentoot.lisp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lazybones-hunchentoot.lisp b/lazybones-hunchentoot.lisp index e87fbd7..b010052 100644 --- a/lazybones-hunchentoot.lisp +++ b/lazybones-hunchentoot.lisp @@ -63,9 +63,11 @@ UNINSTALL-APP, START-SERVER, and STOP-SERVER." (h:stop server)) (defun install-app (server app) - "Installs a LAZYBONES:APP instance to SERVER." - ;; TODO add assertsion here - (push (if (symbolp app) (lzb:app app) app) (acceptor-apps server))) + "Installs a LAZYBONES:APP instance to SERVER, first checking that +the app exists. If app is already isntalled, does nothing." + (a:if-let (app (and app (if (symbolp app) (lzb:app app) app))) + (pushnew app (acceptor-apps server) :key 'lzb::app-name) + (error () "No app to install."))) (defun uninstall-app (server app) (setf (acceptor-apps server) -- cgit v1.2.3