Skip to content

Instantly share code, notes, and snippets.

@ppazos
Created November 15, 2016 02:35
Show Gist options
  • Save ppazos/2543bac3a6561d80d6bf9b275fb9ca12 to your computer and use it in GitHub Desktop.
Save ppazos/2543bac3a6561d80d6bf9b275fb9ca12 to your computer and use it in GitHub Desktop.
groovy check null and empty list, return somethig instead
def nuli = null
def empi = []
def algi = [1,2,3]
println nuli ?: empi
println nuli ?: algi
println empi ?: algi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment