diff --git a/Models/model_mode.cpp b/Models/model_mode.cpp index 0d6634e..1e2db24 100644 --- a/Models/model_mode.cpp +++ b/Models/model_mode.cpp @@ -101,7 +101,11 @@ QVariant Model_Mode::data(const QModelIndex &index, int role) const return "Standard"; case 6: if(data_->getTrackFrameFormat(row).is_initialized()){ - return QString::fromStdString(*data_->getTrackFrameFormat(row).get()); + try { + return QString::fromStdString(*data_->getTrackFrameFormat(row).get()); + } catch (...) { + return "undefined"; + } }else{ return "undefined"; } diff --git a/mainwindow.cpp b/mainwindow.cpp index 7dbafe6..366347d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2223,11 +2223,13 @@ void MainWindow::on_pushButton_startAdvancedMode_clicked() ObsModeDialog *obsModeDial = new ObsModeDialog(obsModeStart, this); int result = obsModeDial->exec(); if(result == QDialog::Accepted){ - advancedObservingMode_ = obsModeDial->getObservingMode(); - updateAdvancedObservingMode(); - + try{ + advancedObservingMode_ = obsModeDial->getObservingMode(); + updateAdvancedObservingMode(); + }catch(...){ + QMessageBox::critical(this, "error using advanced observing mode", "error using advanced observing mode - please check catalogs and entries."); + } } - delete(obsModeDial); }