ckirkendall / kioo

Enlive/Enfocus style templating for Facebook's React and Om in ClojureScript.
Eclipse Public License 1.0
404 stars 39 forks source link

kioo 0.4.0 throws NPE if deftemplate filename does not exist #39

Closed timgilbert closed 9 years ago

timgilbert commented 9 years ago

I'm guessing this is actually a problem in enlive / tagsoup, but it manifests as a kioo problem. If the filename specified in (deftemplate) is not found, lein cljsbuild will fail with a NullPointerException.

I added a gist with a minimal case here, and can provide more detail if needed but this is very easy to reproduce. The full stack trace is here, but the guts of it are basically:

Caused by: java.lang.NullPointerException
    at net.cgrand.tagsoup$parser$fn__4889.invoke(tagsoup.clj:31)
    at net.cgrand.tagsoup$parser.invoke(tagsoup.clj:31)
    at net.cgrand.enlive_html$eval4930$fn__4931.invoke(enlive_html.clj:88)

Possibly this is more of a kioo -> enlive -> tagsoup dependency tree issue, but in the interests of user-friendliness, it would be nice if kioo checked to make sure the filenames specified in deftemplate / defsnippet are accessible, and throw a nicer error if they are not.

jacobemcken commented 9 years ago

I believe your issue will be fixed with e17993a.

timgilbert commented 9 years ago

Fixed in 0.4.1-SNAPSHOT - thanks!