Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ android {
applicationId = "com.eatssu.android"
minSdk = 28
targetSdk = 35
versionCode = 45
versionName = "3.1.7"
versionCode = 46
versionName = "3.1.8"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
5 changes: 1 addition & 4 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
# https://firebase.google.com/docs/database/android/start?hl=ko
-keepattributes Signature

-keep class com.eatssu.android.data.dto.** {
*;
}
-keep class com.eatssu.android.data.enums.** {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 enum core 모듈에 있는데 이거는 따로 안해도 문제 없는건가요??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

놓쳤나해서 확인해보니 core 모듈의 enum은 com.eatssu.common.enums 에요!
지운건 core 분리 리팩토링 이전에 있던 com.eatssu.android.data.enums 니까 영향 없을 것 같아용
릴리즈 빌드해서 기능 정상 작동하는 것도 확인했어요!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿입니다~👍

-keep class com.eatssu.android.data.remote.dto.** {
*;
}
-keep class com.eatssu.android.data.model.** {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.eatssu.common.enums.Restaurant
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import kotlinx.coroutines.tasks.await
import timber.log.Timber
import javax.inject.Inject
Expand Down Expand Up @@ -60,8 +59,7 @@ class FirebaseRemoteConfigRepositoryImpl @Inject constructor(
private fun parseCafeteriaJson(json: String): List<RestaurantInfo> {
return try {
val gson = Gson()
val listType = object : TypeToken<List<RestaurantInfo>>() {}.type
val dtoList: List<RestaurantInfo> = gson.fromJson(json, listType)
val dtoList = gson.fromJson(json, Array<RestaurantInfo>::class.java)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

gson.fromJson은 JSON 문자열이 "null"일 경우 null을 반환할 수 있습니다. 이 경우 dtoListnull이 되어 다음 줄의 dtoList.map 호출 시 NullPointerException이 발생할 수 있습니다. try-catch 블록이 이 예외를 처리하겠지만, null을 명시적으로 처리하는 것이 더 안전하고 코드의 의도를 명확하게 합니다. Elvis 연산자(?:)를 사용하여 null일 경우 빈 배열을 반환하도록 수정하는 것을 권장합니다.

Suggested change
val dtoList = gson.fromJson(json, Array<RestaurantInfo>::class.java)
val dtoList = gson.fromJson(json, Array<RestaurantInfo>::class.java) ?: emptyArray()


dtoList.map { dto ->
RestaurantInfo(
Expand Down