sound may be null if there are no registered leaveWaterSounds. An "if (sound == null)" should be enough.