mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-10-25 06:05:54 +03:00
Make up for the missing condition judgment in last commit
This commit is contained in:
parent
20388c2e7b
commit
3b5124e0b2
1 changed files with 3 additions and 0 deletions
|
@ -216,6 +216,9 @@ public abstract class SearchableBaseNoteFragment extends BaseNoteFragment {
|
|||
}
|
||||
|
||||
private static int countOccurrences(String haystack, String needle) {
|
||||
if (haystack == null || haystack.isEmpty() || needle == null || needle.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
Matcher m = Pattern.compile(needle, Pattern.CASE_INSENSITIVE | Pattern.LITERAL)
|
||||
.matcher(haystack);
|
||||
|
||||
|
|
Loading…
Reference in a new issue