A whole host of changes rescued from the alcoholic laptop.
[clinton/lisp-on-lines.git] / src / components / ajax.lisp
index 7552c41..9f5d5e3 100644 (file)
@@ -165,8 +165,6 @@ but here's what i use."
        :class "auto-complete-list-item"
        (funcall (render auto-complete) value))))))
 
        :class "auto-complete-list-item"
        (funcall (render auto-complete) value))))))
 
-
-
 (defcomponent fkey-auto-complete (auto-complete)
   ())
 
 (defcomponent fkey-auto-complete (auto-complete)
   ())
 
@@ -206,9 +204,11 @@ but here's what i use."
          
 (defaction revert-foreign-slot ((slot ajax-foreign-key-slot-presentation))
   (setf (lol::value (live-search slot)) nil)
          
 (defaction revert-foreign-slot ((slot ajax-foreign-key-slot-presentation))
   (setf (lol::value (live-search slot)) nil)
-  (mewa::sync-foreign-instance slot (original-value slot)))
+  (when (original-value slot)
+  (mewa::sync-foreign-instance slot (original-value slot))))
 
 (defmethod present-slot :around ((slot ajax-foreign-key-slot-presentation) instance)
 
 (defmethod present-slot :around ((slot ajax-foreign-key-slot-presentation) instance)
+
   (let ((foreign-instance 
         (if (lol::value (live-search slot))
             (lol::value (live-search slot))
   (let ((foreign-instance 
         (if (lol::value (live-search slot))
             (lol::value (live-search slot))