If item is null, the code will enter here and we'll have a crash. The condition must be split in two; it item != null, all the code is done (including the if (sendEnabled) ... else ...) ; if it's null, do nothing