mirror of
https://github.com/home-assistant/android
synced 2024-10-15 12:32:54 +00:00
Only attempt to authenticate when connection is not null (#2058)
This commit is contained in:
parent
c46b05fe02
commit
077b4ab368
|
@ -213,14 +213,17 @@ class WebSocketRepositoryImpl @Inject constructor(
|
|||
}
|
||||
|
||||
private suspend fun authenticate() {
|
||||
connection!!.send(
|
||||
mapper.writeValueAsString(
|
||||
mapOf(
|
||||
"type" to "auth",
|
||||
"access_token" to authenticationRepository.retrieveAccessToken()
|
||||
if (connection != null) {
|
||||
connection!!.send(
|
||||
mapper.writeValueAsString(
|
||||
mapOf(
|
||||
"type" to "auth",
|
||||
"access_token" to authenticationRepository.retrieveAccessToken()
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
} else
|
||||
Log.e(TAG, "Attempted to authenticate when connection is null")
|
||||
}
|
||||
|
||||
private fun handleAuthComplete(successful: Boolean) {
|
||||
|
|
Loading…
Reference in a new issue