]> sigrok.org Git - pulseview.git/blobdiff - pv/views/decoder_binary/view.cpp
Fix #1540 by adding a null pointer check
[pulseview.git] / pv / views / decoder_binary / view.cpp
index 5f55b19104d9449e12fc4556861c7546f04be46c..94e9cc673004e75e52195e79a3f980a7af6f37dd 100644 (file)
@@ -206,14 +206,14 @@ void View::remove_decode_signal(shared_ptr<data::DecodeSignal> signal)
 
 void View::save_settings(QSettings &settings) const
 {
-       (void)settings;
+       ViewBase::save_settings(settings);
 }
 
 void View::restore_settings(QSettings &settings)
 {
        // Note: It is assumed that this function is only called once,
        // immediately after restoring a previous session.
-       (void)settings;
+       ViewBase::restore_settings(settings);
 }
 
 void View::reset_data()
@@ -371,8 +371,9 @@ void View::on_selected_class_changed(int index)
 {
        bin_class_id_ = class_selector_->itemData(index).value<uint32_t>();
 
-       binary_data_exists_ =
-               signal_->get_binary_data_chunk_count(current_segment_, decoder_, bin_class_id_);
+       binary_data_exists_ = (signal_) ?
+               signal_->get_binary_data_chunk_count(current_segment_, decoder_, bin_class_id_) :
+               false;
 
        update_data();
 }