Skip to content

Instantly share code, notes, and snippets.

@davidvavra
Created May 3, 2017 10:46
Show Gist options
  • Save davidvavra/8cb71dc604e4ab5a4f586e0153c8c780 to your computer and use it in GitHub Desktop.
Save davidvavra/8cb71dc604e4ab5a4f586e0153c8c780 to your computer and use it in GitHub Desktop.
fun <T1, T2> ifNotNull(value1: T1?, value2: T2?, bothNotNull: (T1, T2) -> (Unit)) {
if (value1 != null && value2 != null) {
bothNotNull(value1, value2)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment