Merge branch 'npeFix' into 'develop'

Add logging for potential NPE

See merge request 
This commit is contained in:
birdbird 2023-03-21 09:04:55 +00:00
commit 7a70c4565c
3 changed files with 7 additions and 5 deletions
gradle_scripts
ultrasonic/src/main/kotlin/org/moire/ultrasonic

@ -31,5 +31,4 @@ if (isCodeQualityEnabled) {
}
tasks.detekt.jvmTarget = "11"
}
}

@ -600,14 +600,17 @@ open class TrackCollectionFragment(
listModel.getRandom(size, append)
} else {
setTitle(name)
requireNotNull(id) {
"ID must be set. NavArgs: ${navArgs.toBundle()}"
}
if (ActiveServerProvider.isID3Enabled()) {
if (isAlbum) {
listModel.getAlbum(refresh2, id!!, name)
listModel.getAlbum(refresh2, id, name)
} else {
throw IllegalAccessException("Use AlbumFragment instead!")
}
} else {
listModel.getMusicDirectory(refresh2, id!!, name)
listModel.getMusicDirectory(refresh2, id, name)
}
}

@ -39,14 +39,14 @@ object CommunicationError {
}
@JvmStatic
fun handleError(error: Throwable?, context: Context?) {
fun handleError(error: Throwable, context: Context?) {
Timber.w(error)
if (context == null) return
ErrorDialog(
context = context,
message = getErrorMessage(error!!, context)
message = getErrorMessage(error, context)
).show()
}