Fix commit crash (#1096)

Fixes another null pointer crash on commits. You can try this on our emoji-java fork, it will crash on `main`.

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1096
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org>
Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
qwerty287 2022-03-27 11:58:33 +02:00 committed by M M Arif
parent 84e8850d9f
commit 062fb9e9fd
2 changed files with 2 additions and 3 deletions

View File

@ -125,7 +125,6 @@ public class CommitsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
TimeHelper
.formatTime(commitsModel.getCommit().getCommitter().getDate(), context.getResources().getConfiguration().locale, "pretty",
context)), HtmlCompat.FROM_HTML_MODE_COMPACT));
}
if(commitsModel.getAuthor() != null && commitsModel.getAuthor().getAvatar_url() != null &&
@ -148,7 +147,7 @@ public class CommitsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
}
if(commitsModel.getCommitter() != null &&
!commitsModel.getAuthor().getLogin().equals(commitsModel.getCommitter().getLogin()) &&
(commitsModel.getAuthor() == null || !commitsModel.getAuthor().getLogin().equals(commitsModel.getCommitter().getLogin())) &&
commitsModel.getCommitter().getAvatar_url() != null &&
!commitsModel.getCommitter().getAvatar_url().isEmpty()) {

View File

@ -195,7 +195,7 @@ public class CommitDetailFragment extends Fragment {
}
if(commitsModel.getCommitter() != null &&
!commitsModel.getAuthor().getLogin().equals(commitsModel.getCommitter().getLogin()) &&
(commitsModel.getAuthor() == null || !commitsModel.getAuthor().getLogin().equals(commitsModel.getCommitter().getLogin())) &&
commitsModel.getCommitter().getAvatar_url() != null &&
!commitsModel.getCommitter().getAvatar_url().isEmpty()) {