diff --git a/modules/ces/system-manager.scm b/modules/ces/system-manager.scm index 54419e2..9e21b6d 100644 --- a/modules/ces/system-manager.scm +++ b/modules/ces/system-manager.scm @@ -38,26 +38,27 @@ (define (add-system-to-system-manager sys-manager sys) "Returns a new system manager with sys added, or false if the input is invalid." - (let ((proc-table (system-manager-proc-table sys-manager)) - (old-systems (systems sys-manager))) - (if (and (system-manager? sys-manager) - (system? sys)) - (make-system-manager (cons sys old-systems) - proc-table) - (error "Invalid inputs to add-system-to-system-manager" - sys-manager sys)))) + (if (and (system-manager? sys-manager) + (system? sys)) + (let ((proc-table (system-manager-proc-table sys-manager)) + (old-systems (systems sys-manager))) + (make-system-manager (cons sys old-systems) proc-table)) + (error "Invalid inputs to add-system-to-system-manager" sys-manager sys))) (define create-system-manager (case-lambda (() (make-system-manager '() (make-eq-hashtable))) ((sys-list) - (fold (lambda (manager sys) - (if (system? sys) - (add-system-to-system-manager manager sys) - manager)) - (create-system-manager) - sys-list)))) + (cond + ((list? sys-list) + (fold (lambda (manager sys) + (when (system? sys) + (add-system-to-system-manager manager sys))) + (create-system-manager) + sys-list)) + (else (error "Incorrect parameter passed to create-system-manager" + sys-list)))))) (define (get-procs-from-table sys-manager entity) (if (and (system-manager? sys-manager)