[NOBTS] Make the stopSample do not cause NullPointerException when the
stopSampling is called even when the startSampling is not invoked.