From 9c5765365292d1ef44f5976d01be176e2bff2bcd Mon Sep 17 00:00:00 2001 From: marina Date: Mon, 23 Mar 2020 16:57:30 +0200 Subject: [PATCH] Check on mail validation if it's not required --- .../com/trufla/androidtruforms/truviews/TruStringView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android-tru-forms/src/main/java/com/trufla/androidtruforms/truviews/TruStringView.java b/android-tru-forms/src/main/java/com/trufla/androidtruforms/truviews/TruStringView.java index 1d3bd39..a0c9e95 100644 --- a/android-tru-forms/src/main/java/com/trufla/androidtruforms/truviews/TruStringView.java +++ b/android-tru-forms/src/main/java/com/trufla/androidtruforms/truviews/TruStringView.java @@ -162,7 +162,8 @@ private boolean checkPattern(String originPattern) { try { Pattern patternObj = Pattern.compile(originPattern); Matcher matcher = patternObj.matcher(extractData()); - if (matcher.matches()) + + if(extractData().isEmpty() || matcher.matches()) return true; } catch (Exception ex) {