Skip to content

Commit

Permalink
Fix log in warning dialog and null exception
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrave-dev committed Nov 6, 2024
1 parent b33b416 commit b2a6f2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ class SimpleMediaServiceHandler(
listTracks = arrayListOf(),
)
}
val current = if (index != null) tempQueue[index] else null
val current = if (index != null) tempQueue.getOrNull(index) else null
chunkedList.forEach { list ->
val catalogMetadata: ArrayList<Track> = arrayListOf()
Log.w("SimpleMediaServiceHandler", "Catalog size: ${tempQueue.size}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import androidx.media3.common.util.UnstableApi
import androidx.media3.exoplayer.offline.Download
import com.maxrave.kotlinytmusicscraper.YouTube
import com.maxrave.simpmusic.R
import com.maxrave.simpmusic.common.DownloadState
import com.maxrave.simpmusic.common.SELECTED_LANGUAGE
Expand Down Expand Up @@ -87,7 +86,7 @@ class HomeViewModel(
val showLogInAlert: StateFlow<Boolean> = _showLogInAlert

init {
if (YouTube.cookie.isNullOrEmpty()) {
if (runBlocking{ dataStoreManager.cookie.first() }.isEmpty()) {
_showLogInAlert.update { true }
}
homeJob = Job()
Expand Down

0 comments on commit b2a6f2e

Please sign in to comment.