Permalink
Browse files

fix null pointer exception in slime-find-file if pass nil file arg

  • Loading branch information...
1 parent 3409062 commit 39b0242fb63b46e38717530a9dcf525f8f385447 @tavisrudd tavisrudd committed Jan 19, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/swank/commands/basic.clj
@@ -413,9 +413,10 @@ that symbols accessible in the current namespace go first."
(slime-file-resource resource))))
(defn- slime-find-file [#^String file]
- (if (.isAbsolute (File. file))
- (list :file file)
- (slime-find-resource file)))
+ (if file
+ (if (.isAbsolute (File. file))
+ (list :file file)
+ (slime-find-resource file))))
(defn- namespace-to-path [ns]
(let [#^String ns-str (name (ns-name ns))
@@ -482,6 +483,7 @@ that symbols accessible in the current namespace go first."
(location ns nil path 1))))
(defn- find-var-definition [sym-name]
+ ;; TODO this doesn't work if sym-name refers to a protocol function
(if-let [meta (meta (maybe-resolve-sym sym-name))]
(source-location-for-meta meta "defn")))

0 comments on commit 39b0242

Please sign in to comment.