Kenneth
03/10/2020, 8:29 AMdiesieben07
03/10/2020, 8:41 AMif (foo != null) {
myFunction(foo)
}
diesieben07
03/10/2020, 8:42 AMEivind Nilsbakken
03/10/2020, 8:50 AMif/else
with a default value or use non-null assertions, if you want an exception to be thrown if any of the variables are null.August Gruneisen
03/10/2020, 3:34 PMfoo?.let{ myFunction(it) }
corneil
03/10/2020, 8:09 PMrequire(foo!=null) { "foo is required" }
myFunction(foo)
Milan Hruban
03/11/2020, 6:24 AMrequireNotNull(foo) { "..." }
corneil
03/11/2020, 8:19 AMDaniel
03/11/2020, 10:08 PMif(foo == null) return
myFunction(foo)