day8 / re-frame-10x

A debugging dashboard for re-frame. X-ray vision as tooling.
MIT License
634 stars 68 forks source link

Prevent nil component path from trace map #245

Closed dpsutton closed 5 years ago

dpsutton commented 5 years ago

The computation of component path allows for nil and the part that uses it checks for the absence of a value but not the presence of nil in the map.

(defn log-trace? [trace]
  (let [render-operation? (or (= (:op-type trace) :render)
                              (= (:op-type trace) :componentWillUnmount))
        component-path    (get-in trace [:tags :component-path] "")] ;; doesn't guard against nil in the map
    (if-not render-operation?
      true
      (not (str/includes? component-path "devtools outer")))))
dpsutton commented 5 years ago

friendly ping :) if you have any concerns or thoughts about the simple change.

superstructor commented 5 years ago

Thanks @dpsutton and apologies for the delay in getting to this!