Skip to content

Commit cf578d0

Browse files
committed
guard on no ns decl in JAR
1 parent 70065a8 commit cf578d0

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,34 @@ This project follows the version scheme MAJOR.MINOR.PATCH where each component p
2323

2424
### Stable Release ###
2525

26-
Latest stable release is [1.4.3](https://github.com/clojure/tools.namespace/tree/v1.4.3)
26+
Latest stable release is [1.4.4](https://github.com/clojure/tools.namespace/tree/v1.4.4)
2727

2828
[CLI/`deps.edn`](https://clojure.org/reference/deps_and_cli) dependency information:
2929
```clojure
30-
org.clojure/tools.namespace {:mvn/version "1.4.3"}
30+
org.clojure/tools.namespace {:mvn/version "1.4.4"}
3131
```
3232

3333
[Leiningen](https://leiningen.org/) stable dependency information:
3434

35-
[org.clojure/tools.namespace "1.4.3"]
35+
[org.clojure/tools.namespace "1.4.4"]
3636

3737
[Maven](https://maven.apache.org/) stable dependency information:
3838

3939
<dependency>
4040
<groupId>org.clojure</groupId>
4141
<artifactId>tools.namespace</artifactId>
42-
<version>1.4.3</version>
42+
<version>1.4.4</version>
4343
</dependency>
4444

4545
### Development Snapshots ###
4646

47-
Git master branch is at **1.4.3-SNAPSHOT**
47+
Git master branch is at **1.4.5-SNAPSHOT**
4848

4949
[All Snapshot Versions](https://oss.sonatype.org/content/groups/public/org/clojure/tools.namespace/)
5050

5151
Leiningen dependency information for development snapshots:
5252

53-
:dependencies [[org.clojure/tools.namespace "1.4.4-SNAPSHOT"]]
53+
:dependencies [[org.clojure/tools.namespace "1.4.5-SNAPSHOT"]]
5454
:repositories [["sonatype-oss-public"
5555
"https://oss.sonatype.org/content/groups/public/"]]
5656

src/main/clojure/clojure/tools/namespace/find.clj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,11 @@
154154
(io/reader
155155
(.getInputStream jarfile (.getEntry jarfile entry-name))))]
156156
(ignore-reader-exception
157-
(let [[_ nom & more] (parse/read-ns-decl rdr read-opts)]
158-
(list* 'ns (with-meta nom
159-
{:jar (.getName ^JarFile jarfile) :file entry-name})
160-
more)))))))
157+
(let [[_ nom & more :as decl] (parse/read-ns-decl rdr read-opts)]
158+
(when (and decl nom (symbol? nom))
159+
(list* 'ns (with-meta nom
160+
{:jar (.getName ^JarFile jarfile) :file entry-name})
161+
more))))))))
161162

162163
(defn find-ns-decls-in-jarfile
163164
"Searches the JAR file for source files containing (ns ...)

0 commit comments

Comments
 (0)