Uploaded image for project: 'Clojure'
  1. CLJ-844

NPE calling keyword on map from bean

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Affects versions: Release 1.3, Release 1.2
    • Fix versions: Release 1.5
    • Labels:
      None
    • Approval:
      Ok
    • Patch:
      Code and Test

      Description

      Calling a keyword on a map returned from clojure.core/bean causes a null pointer exception if the keyword is not a key in the map:

      user=> (:a (bean {}))
      java.lang.NullPointerException (NO_SOURCE_FILE:0)
      user=> (.printStackTrace *e)
      Caused by: java.lang.NullPointerException
      at clojure.core$bean$v__4765.invoke(core_proxy.clj:385)
      at clojure.core$bean$fn__4786.invoke(core_proxy.clj:394)
      at clojure.core.proxy$clojure.lang.APersistentMap$0.valAt(Unknown Source)
      at clojure.lang.KeywordLookupSite.fault(KeywordLookupSite.java:33)
      at user$eval1062.invoke(NO_SOURCE_FILE:7)
      at clojure.lang.Compiler.eval(Compiler.java:5424)
      ... 9 more

      The object returned by bean claims to be an APersistentMap FWIW:

      user=> (class (bean {}))
      clojure.core.proxy$clojure.lang.APersistentMap$0

        Attachments

          Activity

            People

            • Assignee:
              steveminer@gmail.com Steve Miner
              Reporter:
              alex+import import
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: