Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
[fix] NPE in NameableSet
Browse files Browse the repository at this point in the history
  • Loading branch information
Luna5ama committed Jan 7, 2021
1 parent 110cc5b commit d425214
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion org/kamiblue/commons/collections/NameableSet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ open class NameableSet<T : Nameable> : AbstractMutableSet<T>() {

override fun iterator() = map.values.iterator()

operator fun get(name: String?) = map[name?.toLowerCase()]
operator fun get(name: String) = map[name.toLowerCase()]

fun getOrPut(name: String, value: () -> T) = get(name) ?: value().also { add(it) }

Expand Down

0 comments on commit d425214

Please sign in to comment.