Commit 10df7f20 authored by Geoffrey Métais's avatar Geoffrey Métais

ModelsHelper: Sanity check

parent 4574b40a
......@@ -106,7 +106,7 @@ object ModelsHelper {
return if (item.title.isEmpty() || !Character.isLetter(item.title[0]) || ModelsHelper.isSpecialItem(item)) "#" else item.title.substring(0, 1).toUpperCase()
}
fun getHeader(context: Context, sort: Int, item: MediaLibraryItem, aboveItem: MediaLibraryItem?) = when (sort) {
fun getHeader(context: Context?, sort: Int, item: MediaLibraryItem, aboveItem: MediaLibraryItem?) = if (context !== null) when (sort) {
Medialibrary.SORT_DEFAULT,
Medialibrary.SORT_FILENAME,
Medialibrary.SORT_ALPHA -> {
......@@ -160,7 +160,7 @@ object ModelsHelper {
}
}
else -> null
}
} else null
private fun getTimeCategory(timestamp: Long): Int {
val delta = (System.currentTimeMillis() / 1000L) - timestamp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment