Skip to content

Commit

Permalink
No longer crashing if you somehow access the dashboard but you're not…
Browse files Browse the repository at this point in the history
… a member of any projects. (#218)
  • Loading branch information
eoji authored Feb 23, 2018
1 parent e07c9c0 commit 4cc7c27
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.kickstarter.libs.ActivityViewModel;
import com.kickstarter.libs.Environment;
import com.kickstarter.libs.utils.ListUtils;
import com.kickstarter.libs.utils.ObjectUtils;
import com.kickstarter.models.Project;
import com.kickstarter.services.ApiClientType;
import com.kickstarter.services.apiresponses.ProjectStatsEnvelope;
Expand Down Expand Up @@ -60,7 +61,8 @@ public ViewModel(final @NonNull Environment environment) {
.map(ListUtils::first);

final Observable<Project> currentProject = Observable
.merge(firstProject, this.projectSelectionInput);
.merge(firstProject, this.projectSelectionInput)
.filter(ObjectUtils::isNotNull);

final Observable<Notification<ProjectStatsEnvelope>> projectStatsEnvelopeNotification = currentProject
.switchMap(this.client::fetchProjectStats)
Expand Down

0 comments on commit 4cc7c27

Please sign in to comment.