string-match-p throws an error if given an invalid regexp, which is what we *should* be testing for, not its return value (which should be ignored), but this wasn't the case before this commit. Fix: #6534