takeUnlessEmpty

fun ItemStack.takeUnlessEmpty(): ItemStack?

Returns null if this isEmpty, otherwise returns this.