getOrNull

abstract fun <T : Any> getOrNull(key: AttributeKey<T>): T?

Get a value of the attribute for the specified key or null