Clojure

NullPointerException possible with seq-zip

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.3
  • Fix Version/s: None
  • Component/s: None
  • Labels:

Description

For example:

Clojure 1.3.0
user=> (require '[clojure.zip :as z])
nil
user=> (-> (z/seq-zip (list 1)) z/down z/remove)
NullPointerException clojure.core/with-meta (core.clj:211)

Possibly the make-node function for seq-zip should be:

(fn [node children] (with-meta (or children ()) (meta node)))

Activity

Hide
Greg Chapman added a comment -

Also the docstring for zipper should probably be updated to indicate that the children parameter can be nil.

Show
Greg Chapman added a comment - Also the docstring for zipper should probably be updated to indicate that the children parameter can be nil.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: