[Fix error caused by invoking the thread browser at the top level.
Taylor R Campbell <campbell@mumble.net>**20070628191454
 
 Check first whether we are at the top level, and if so, refuse to
 browse threads.  We can browse only the threads of previous levels, but
 the top level has no previous level.  Formerly, SLIME48 would hang with
 an error trying to pass false to a record accessor.
] {
hunk ./session.scm 788
-  (level-threads (level-parent level)))
+  (cond ((level-parent level) => level-threads)
+        (else #f)))
hunk ./thread.scm 20
-    (if (and threads
-             (eq? (car threads) level))
-        (cdr threads)
-        (let ((threads
-               (weak-table-values->list (current-swank-threads))))
-          (set-cached-swank-threads! (cons level threads))
-          threads))))
+    (cond ((and threads
+                (eq? (car threads) level))
+           (cdr threads))
+          ((current-swank-threads)
+           => (lambda (threads)
+                (let ((threads (weak-table-values->list threads)))
+                  (set-cached-swank-threads! (cons level threads))
+                  threads)))
+          (else
+           (abort-swank-rpc "(session ~S) No threads to browse at top level"
+                            (swank-session-id (current-swank-session)))))))
}
