mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-10-25 14:15:48 +03:00
Make up for the missing condition judgment in last commit
This commit is contained in:
parent
be2c17d2d3
commit
b674d6351a
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) {
|
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 m = Pattern.compile(needle, Pattern.CASE_INSENSITIVE | Pattern.LITERAL)
|
||||||
.matcher(haystack);
|
.matcher(haystack);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue