takeUnlessEmpty

fun ItemStack.takeUnlessEmpty(): ItemStack?

Returns null if this is empty, otherwise returns this.