Skip to content

modify fails when .f returns NULL #753

@vspinu

Description

@vspinu

purrr::modify.default should check explicitly for null values

X <- list(a = 1, b = NULL, c = 3)
purrr:::modify(X, identity)
#> Error in .x[[i]]: subscript out of bounds

Created on 2020-03-18 by the reprex package (v0.3.0)

Likely duplicates #655 and #746. Creating the new issue with simple reprex to create a sense of urgency :) If a simple check for NULL in modify.default is ok with you I can create a PR and add tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviormodify 🛠️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions