Add null check to long press to avoid NPE