rm-hull / programming-enchiladas

A ClojureScript-based HTML5 Canvas and SVG Graphics Playground, much like http://bl.ocks.org/ but specifically for showcasing small ClojuresScript code demos: The underlying agenda is to show how small simple functional programs can generate complex behaviour.
programming-enchiladas.destructuring-bind.org
138 stars 18 forks source link

(New?) forks show a blank page #5

Closed maravillas closed 10 years ago

maravillas commented 10 years ago

See http://programming-enchiladas.destructuring-bind.org/maravillas/cbad41ed792d2a0887fe (from https://gist.github.com/maravillas/cbad41ed792d2a0887fe), which is a fork of [https://gist.github.com/swannodette/5903001(https://gist.github.com/swannodette/5903001).

rm-hull commented 10 years ago

When running as an uberjar it looks like any crashes don't show the stack trace, but since I've subsequently altered the server to run in development mode (for issue #4), it becomes apparent what the issue is when running http://programming-enchiladas.destructuring-bind.org/maravillas/cbad41ed792d2a0887fe :

java.lang.NullPointerException
string.clj:99   clojure.string/replace
page.clj:14 enchilada.util.page/add-anchors
canvas.clj:30   enchilada.views.canvas/meta-info
canvas.clj:43   enchilada.views.canvas/render-page
canvas.clj:70   enchilada.controllers.canvas/fn
core.clj:99 compojure.core/make-route[fn]
core.clj:45 compojure.core/if-route[fn]
core.clj:30 compojure.core/if-method[fn]
core.clj:112    compojure.core/routing[fn]
core.clj:2515   clojure.core/some
core.clj:112    compojure.core/routing
RestFn.java:139 clojure.lang.RestFn.applyTo
core.clj:626    clojure.core/apply
core.clj:117    compojure.core/routes[fn]
core.clj:112    compojure.core/routing[fn]
core.clj:2515   clojure.core/some
core.clj:112    compojure.core/routing
RestFn.java:139 clojure.lang.RestFn.applyTo
core.clj:626    clojure.core/apply
core.clj:117    compojure.core/routes[fn]
keyword_params.clj:35   ring.middleware.keyword-params/wrap-keyword-params[fn]
nested_params.clj:84    ring.middleware.nested-params/wrap-nested-params[fn]
params.clj:64   ring.middleware.params/wrap-params[fn]
multipart_params.clj:118    ring.middleware.multipart-params/wrap-multipart-params[fn]
flash.clj:35    ring.middleware.flash/wrap-flash[fn]
session.clj:98  ring.middleware.session/wrap-session[fn]
gzip.clj:69 ring.middleware.gzip/wrap-gzip[fn]
cache.clj:72    enchilada.middleware.cache/wrap-cache-control[fn]
middleware.clj:12   hiccup.middleware/wrap-base-url[fn]
params.clj:64   ring.middleware.params/wrap-params[fn]
Var.java:379    clojure.lang.Var.invoke
reload.clj:18   ring.middleware.reload/wrap-reload[fn]
stacktrace.clj:17   ring.middleware.stacktrace/wrap-stacktrace-log[fn]
stacktrace.clj:80   ring.middleware.stacktrace/wrap-stacktrace-web[fn]
jetty.clj:18    ring.adapter.jetty/proxy-handler[fn]
(Unknown Source)    ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle
HandlerWrapper.java:116 org.eclipse.jetty.server.handler.HandlerWrapper.handle
Server.java:363 org.eclipse.jetty.server.Server.handle
AbstractHttpConnection.java:483 org.eclipse.jetty.server.AbstractHttpConnection.handleRequest
AbstractHttpConnection.java:920 org.eclipse.jetty.server.AbstractHttpConnection.headerComplete
AbstractHttpConnection.java:982 org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete
HttpParser.java:635 org.eclipse.jetty.http.HttpParser.parseNext
HttpParser.java:235 org.eclipse.jetty.http.HttpParser.parseAvailable
AsyncHttpConnection.java:82 org.eclipse.jetty.server.AsyncHttpConnection.handle
SelectChannelEndPoint.java:628  org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle
SelectChannelEndPoint.java:52   org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run
QueuedThreadPool.java:608   org.eclipse.jetty.util.thread.QueuedThreadPool.runJob
QueuedThreadPool.java:543   org.eclipse.jetty.util.thread.QueuedThreadPool$3.run
Thread.java:744 java.lang.Thread.run

Basically, because there is no description on the gist, the NPE is thrown because the add-anchors method doesn't do any null-checking... whoopsie