From aedf15225b919eea0824bbab174c647b0997f4ea Mon Sep 17 00:00:00 2001 From: bingbong Date: Fri, 6 Aug 2021 16:36:28 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20UserData=20=ED=81=B4=EB=9E=98?= =?UTF-8?q?=EC=8A=A4=20nullable=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iamport/sdk/data/chai/response/UserData.kt | 8 +++++--- .../iamport/sdk/presentation/viewmodel/MainViewModel.kt | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sdk/src/main/java/com/iamport/sdk/data/chai/response/UserData.kt b/sdk/src/main/java/com/iamport/sdk/data/chai/response/UserData.kt index a73b0353..d9972bc9 100644 --- a/sdk/src/main/java/com/iamport/sdk/data/chai/response/UserData.kt +++ b/sdk/src/main/java/com/iamport/sdk/data/chai/response/UserData.kt @@ -2,9 +2,11 @@ package com.iamport.sdk.data.chai.response import com.iamport.sdk.data.sdk.PG +// PG정보가 없어도(회원가입 후 즉시 or PG 를 API 방식으로만 이용하는 경우 or 본인인증만 이용하는 경우) 에도 +// pg_id 가 null 로 해당 데이터가 하나는 무조건 있으므로 다 nullable 처리한다 ㅠ data class UserData( - val pg_provider: String?, // TODO: 2020-12-15 015 nullable 로 오는데.. 확인필요.. - val pg_id: String, + val pg_provider: String?, + val pg_id: String?, val sandbox: Boolean?, - val type: String, + val type: String?, ) \ No newline at end of file diff --git a/sdk/src/main/java/com/iamport/sdk/presentation/viewmodel/MainViewModel.kt b/sdk/src/main/java/com/iamport/sdk/presentation/viewmodel/MainViewModel.kt index e51b9432..01d2dbe3 100644 --- a/sdk/src/main/java/com/iamport/sdk/presentation/viewmodel/MainViewModel.kt +++ b/sdk/src/main/java/com/iamport/sdk/presentation/viewmodel/MainViewModel.kt @@ -121,7 +121,11 @@ class MainViewModel(private val bus: NativeLiveDataEventBus, private val reposit d("$this") when (first) { - JudgeStrategy.JudgeKinds.CHAI -> second?.let { repository.chaiStrategy.doWork(it.pg_id, third) } + JudgeStrategy.JudgeKinds.CHAI -> second?.let { + it.pg_id?.let { pgId -> + repository.chaiStrategy.doWork(pgId, third) + } + } JudgeStrategy.JudgeKinds.WEB, JudgeStrategy.JudgeKinds.CERT -> bus.webViewActivityPayment.postValue(Event(third)) else -> Logger.e("판단불가 $third")