-
Notifications
You must be signed in to change notification settings - Fork 70
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
parseCssColors(): treat incoming NAs as an invalid color #194
Conversation
…n (instead of throwing with an unintelligible error. Closes #161
7d35370
to
adb0bed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Can you also add a NEWS item?
R/colors.R
Outdated
# Note that an empty string is not a valid color, so parsing fails | ||
# on NA input values, and thus, will be converted back to NA | ||
# when `mustWork = FALSE` | ||
if (!(is.character(str) || rlang::is_na(str))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what about the cases where it's a vector of (non-character) NA
s? As in:
parseCssColors(c(NA, NA))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason I was thinking that'd be a character vector, but I suppose logical makes way more sense!
Closes #161