From c40508eb16369eecf1efe42d0313b3b4ebc6cd0f Mon Sep 17 00:00:00 2001 From: Karsten von Hornbostel Date: Tue, 8 Mar 2016 21:25:27 +0100 Subject: [PATCH] fixed crash when QFileDialog is closed without selecting a file --- spectrogramcontrols.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spectrogramcontrols.cpp b/spectrogramcontrols.cpp index cfcb102..c004224 100644 --- a/spectrogramcontrols.cpp +++ b/spectrogramcontrols.cpp @@ -127,7 +127,8 @@ void SpectrogramControls::fileOpenButtonClicked() QString fileName = QFileDialog::getOpenFileName( this, tr("Open File"), "", tr("Sample file (*.cfile *.bin);;All files (*)") ); - emit openFile(fileName); + if (!fileName.isEmpty()) + emit openFile(fileName); } void SpectrogramControls::timeSelectionChanged(float time)