catch NaNs in waveform histogram creation