From 4f79ea0156d8f18dc0b3fdddbc000e9e17c1a503 Mon Sep 17 00:00:00 2001 From: 6543 <6543@noreply.codeberg.org> Date: Wed, 24 Jun 2020 17:05:02 +0200 Subject: [PATCH] Fix Crash when searching issues/pr (#547) fix in pr and ms fragments Fix Crash when searching issues/pr Co-authored-by: M M Arif Co-authored-by: 6543 <6543@obermui.de> Reviewed-by: M M Arif --- .../main/java/org/mian/gitnex/fragments/IssuesFragment.java | 3 +++ .../java/org/mian/gitnex/fragments/MilestonesFragment.java | 3 +++ .../java/org/mian/gitnex/fragments/PullRequestsFragment.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/app/src/main/java/org/mian/gitnex/fragments/IssuesFragment.java b/app/src/main/java/org/mian/gitnex/fragments/IssuesFragment.java index 01a216f5..b94c0f78 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/IssuesFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/IssuesFragment.java @@ -325,6 +325,9 @@ public class IssuesFragment extends Fragment { List arr = new ArrayList<>(); for(Issues d : issuesList) { + if(d == null || d.getTitle() == null || d.getBody() == null) { + continue; + } if(d.getTitle().toLowerCase().contains(text) || d.getBody().toLowerCase().contains(text)) { arr.add(d); } diff --git a/app/src/main/java/org/mian/gitnex/fragments/MilestonesFragment.java b/app/src/main/java/org/mian/gitnex/fragments/MilestonesFragment.java index 4aac3653..d7698f3c 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/MilestonesFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/MilestonesFragment.java @@ -318,6 +318,9 @@ public class MilestonesFragment extends Fragment { List arr = new ArrayList<>(); for(Milestones d : dataList) { + if(d == null || d.getTitle() == null || d.getDescription() == null) { + continue; + } if(d.getTitle().toLowerCase().contains(text) || d.getDescription().toLowerCase().contains(text)) { arr.add(d); } diff --git a/app/src/main/java/org/mian/gitnex/fragments/PullRequestsFragment.java b/app/src/main/java/org/mian/gitnex/fragments/PullRequestsFragment.java index 6ce0399d..d6ea3bb2 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/PullRequestsFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/PullRequestsFragment.java @@ -332,6 +332,9 @@ public class PullRequestsFragment extends Fragment { List arr = new ArrayList<>(); for(PullRequests d : prList) { + if(d == null || d.getTitle() == null || d.getBody() == null) { + continue; + } if(d.getTitle().toLowerCase().contains(text) || d.getBody().toLowerCase().contains(text)) { arr.add(d); }