Ensure patterns is array