You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lateinit property has not been initialized private lateinit var address: String 프로퍼티가 초기화 되기 전에 호출되며 액티비티가 종료되는 버그 발생
privatefunfetchAddress(location:Location) {
lifecycleScope.launch {
val defaultDelayJob =
launch {
delay(500L)
}
val getCurrentLocationJob =
launch {
updateAddressByCurrentAddress(location)
}
getCurrentLocationJob.join()
defaultDelayJob.join()
viewModel.setPlaceByCurrentAddress(address, location) // -> 이 부분에서 발생
}
}
원인
코드 순서 상 updateAddressByCurrentAddress(location)에서 프로퍼티가 초기화된 후 viewModel.setPlaceByCurrentAddress(address, location) 라인이 호출되고 있는데
has not been initialized가 왜 발생하는지 모르겠네요.. 원인을 좀 더 살펴보겠습니다.
😇 이때까지 끝낼게요!
우선 까먹지 않도록 이슈 먼저 올려놓고 현재 열려있는 PR 머지 후 가장 우선적으로 수정하겠습니다.
🤮 As Is (오마이갓 비상사태)
lateinit property has not been initialized
private lateinit var address: String
프로퍼티가 초기화 되기 전에 호출되며 액티비티가 종료되는 버그 발생원인
코드 순서 상 updateAddressByCurrentAddress(location)에서 프로퍼티가 초기화된 후 viewModel.setPlaceByCurrentAddress(address, location) 라인이 호출되고 있는데
has not been initialized가 왜 발생하는지 모르겠네요.. 원인을 좀 더 살펴보겠습니다.
😇 이때까지 끝낼게요!
우선 까먹지 않도록 이슈 먼저 올려놓고 현재 열려있는 PR 머지 후 가장 우선적으로 수정하겠습니다.
The text was updated successfully, but these errors were encountered: