Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the test #98

Merged
merged 2 commits into from
Feb 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ public void testEqualFilter() {
assertEquals(filter1.hashCode(), filter2.hashCode());

Milestone milestone = new Milestone().setNumber(3);
filter1.setMilestone(milestone);
com.github.mobile.api.model.Milestone extraMilestone = new com.github.mobile.api.model.Milestone(milestone);
filter1.setMilestone(extraMilestone);
assertFalse(filter1.equals(filter2));
filter2.setMilestone(milestone);
filter2.setMilestone(extraMilestone);
assertEquals(filter1, filter2);
assertEquals(filter1.hashCode(), filter2.hashCode());
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/github/mobile/api/model/Milestone.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public Milestone(org.eclipse.egit.github.core.Milestone milestone) {
this.state = milestone.getState();
this.title = milestone.getTitle();
this.description = milestone.getDescription();
this.creator = new User(milestone.getCreator());
org.eclipse.egit.github.core.User creator = milestone.getCreator();
this.creator = creator == null ? null : new User(creator);
this.open_issues = milestone.getOpenIssues();
this.closed_issues = milestone.getClosedIssues();
this.created_at = milestone.getCreatedAt();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ private void updateLabels() {
}

private void updateMilestone() {
Milestone selected = filter.getMilestone().getOldModel();
com.github.mobile.api.model.Milestone selected = filter.getMilestone();
if (selected != null)
milestoneText.setText(selected.getTitle());
milestoneText.setText(selected.getOldModel().getTitle());
else
milestoneText.setText(R.string.none);
}
Expand Down