shinyvalidate icon indicating copy to clipboard operation
shinyvalidate copied to clipboard

sv_regex throws error when value is NULL

Open Sebastian-T-T opened this issue 3 years ago • 0 comments

The sv_regex function will throw an error if the value is NULL.

If the checked value is NULL, then the value of 'result' will be 'logical(0)', causing this line in the code to throw an error: https://github.com/rstudio/shinyvalidate/blob/575f5865fcb028656b58760ba357b6247b97d866/R/rules.R#L260

A fix would be to change this line to: if (!isTRUE(result)) {

Sebastian-T-T avatar Jul 22 '22 07:07 Sebastian-T-T