Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent nil component path from trace map #245

Merged
merged 1 commit into from
Oct 12, 2019

Conversation

dpsutton
Copy link
Contributor

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
Copy link
Contributor Author

dpsutton commented Aug 1, 2019

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

@superstructor superstructor merged commit 477fd80 into day8:master Oct 12, 2019
@superstructor
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants