Simplify nullable return

This commit is contained in:
Nicholas Wallace 2025-02-01 15:32:34 -07:00
parent d4090d15be
commit 9e7a76bd97

View file

@ -87,8 +87,7 @@ object DeviceManager {
* @return The ServerConnectionConfig instance or null if not found.
*/
fun getServerConnectionConfig(id: String?): ServerConnectionConfig? {
if (id == null) return null
return deviceData.serverConnectionConfigs.find { it.id == id }
return id?.let { deviceData.serverConnectionConfigs.find { it.id == id } }
}
/**