Skip to content
This repository has been archived by the owner on Jan 23, 2018. It is now read-only.

Commit

Permalink
fix null pointer exception in slime-find-file if pass nil file arg
Browse files Browse the repository at this point in the history
  • Loading branch information
tavisrudd committed Jan 19, 2012
1 parent 3409062 commit 39b0242
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/swank/commands/basic.clj
Expand Up @@ -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))
Expand Down Expand Up @@ -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")))

Expand Down

0 comments on commit 39b0242

Please sign in to comment.