Skip to content

Commit

Permalink
[MOD/#60] null 처리 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyobeen-Park committed Jul 13, 2024
1 parent 56d273b commit 238ae15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ fun HomeScreen(
}
}

if (userNameState.internFilter != null && recommendInternData != null) {
items(recommendInternData!!.size) { index ->
ShowRecommendIntern(recommendInternData!![index])
if (userNameState.internFilter != null && recommendInternData.isNotEmpty()) {
items(recommendInternData.size) { index ->
ShowRecommendIntern(recommendInternData[index])
}
}
}
Expand All @@ -151,7 +151,7 @@ fun HomeScreen(
.padding(horizontal = 24.dp)
.fillMaxSize()
)
} else if (recommendInternData == null) {
} else if (recommendInternData.isEmpty()) {
HomeRecommendEmptyIntern()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ class HomeViewModel @Inject constructor(
)
val scrapData get() = _scrapState.asStateFlow()

private val _recommendInternState = MutableStateFlow<List<RecommendInternData>?>(
getRecommendData()
private val _recommendInternState = MutableStateFlow<List<RecommendInternData>>(
// getRecommendData()
listOf()
)
val recommendInternData get() = _recommendInternState.asStateFlow()
}
Expand Down

0 comments on commit 238ae15

Please sign in to comment.