add ternary to catch possible null pointer bump

This commit is contained in:
Charles J. Cliffe 2015-05-28 18:30:53 -04:00
parent 2a9eadbf9a
commit 24179afd28

View File

@ -61,7 +61,9 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
if (!wxGetApp().getAudioVisualQueue()->empty()) {
AudioThreadInput *demodAudioData;
wxGetApp().getAudioVisualQueue()->pop(demodAudioData);
int iMax = demodAudioData->data.size();
int iMax = demodAudioData?demodAudioData->data.size():0;
if (demodAudioData && iMax) {
if (waveform_points.size() != iMax * 2) {
waveform_points.resize(iMax * 2);