        (lambda (recipe)
          (straight--with-plist recipe
              (local-repo package)
-           (unless (or (assoc local-repo versions-alist)
+           (unless (or (null local-repo)
+                       (assoc local-repo versions-alist)
                        (straight--repository-is-available-p recipe))
              (straight-use-package (intern package)))))))
     (dolist (spec straight-profiles)

           (lambda (recipe)
             (straight--with-plist recipe
                 (package local-repo type)
               (when (memq profile (gethash package straight--profile-cache))
                 (push (cons local-repo
                             (or (cdr (assoc local-repo versions-alist))
                                 (straight-vc-get-commit type local-repo)))

              (let ((unpushed-recipes
                     (straight-push-all
                      (lambda (package)
                        (let ((recipe
                               (gethash package straight--recipe-cache)))
                          (straight--with-plist recipe
                              (local-repo)
                            (and local-repo
                                 (straight--repository-is-available-p
                                  recipe))))))))
                (or
                 (null unpushed-recipes)
                 (straight-are-you-sure
