Skip to content

Commit

Permalink
Add image pool
Browse files Browse the repository at this point in the history
  • Loading branch information
wtlgo committed Nov 26, 2023
1 parent 28de56a commit ce1cb9b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/dev/mikchan/mcnp/motd/image/pool/ImagePool.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ internal class ImagePool(private val plugin: MOTDPlugin) : IImagePool {
}

override fun getRandom(): CachedServerIcon? {
val cache = this.cache
if (cache.isEmpty()) return null
return cache.values.random()
return cache.values.ifEmpty { null }?.random()
}

override fun preload() {
Expand Down

0 comments on commit ce1cb9b

Please sign in to comment.