Skip to content

Commit

Permalink
Remove a couple potential nulls from mappers in the ProjectCardHolder…
Browse files Browse the repository at this point in the history
… ViewModel (#1908)

* remove a couple nulls in mappers

* update version codes
  • Loading branch information
mtgriego committed Nov 29, 2023
1 parent 884f1ba commit b775a05
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/external_version_code.txt
@@ -1 +1 @@
2014150885
2014150886
2 changes: 1 addition & 1 deletion app/internal_version_code.txt
@@ -1 +1 @@
2014150888
2014150889
Expand Up @@ -398,9 +398,8 @@ interface ProjectCardHolderViewModel {
.map { it.photo().isNull() }

project
.filter { it.isNotNull() }
.map { it.location() }
.filter { it.isNotNull() }
.filter { it.isNotNull() && it.location().isNotNull() }
.map { requireNotNull(it.location()) }
.map { it.displayableName() }
.distinctUntilChanged()
.subscribe { locationName.onNext(it) }
Expand Down Expand Up @@ -472,7 +471,7 @@ interface ProjectCardHolderViewModel {
.filter { it.isNotNull() }
.map {
if (it.photo() == null) {
null
""
} else {
it.photo()?.full()
}
Expand All @@ -498,10 +497,8 @@ interface ProjectCardHolderViewModel {
.map { it.negate() }

val projectCategory = project
.filter { it.isNotNull() }
.map { it.category() }
.filter { it.isNotNull() }
.map { it }
.filter { it.isNotNull() && it.category() != null }
.map { requireNotNull(it.category()) }

projectSubcategoryIsGone = discoveryParams
.filter { it.category().isNotNull() }
Expand Down Expand Up @@ -545,9 +542,8 @@ interface ProjectCardHolderViewModel {
.distinctUntilChanged()

rootCategoryNameForFeatured = projectCategory
.filter { it.isNotNull() }
.map { it.root() }
.filter { it.isNotNull() }
.filter { it.isNotNull() && it.root().isNotNull() }
.map { requireNotNull(it.root()) }
.map { it.name() }

savedViewGroupIsGone = project
Expand Down

0 comments on commit b775a05

Please sign in to comment.