From 4d0f333acdcd747ffc542d77e679ce08af6031ae Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Tue, 23 Jun 2020 20:31:10 +0200 Subject: [PATCH] TabularDecView: Try to handle a race condition in the model --- pv/views/tabular_decoder/model.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pv/views/tabular_decoder/model.cpp b/pv/views/tabular_decoder/model.cpp index 110cfd62..b87bf058 100644 --- a/pv/views/tabular_decoder/model.cpp +++ b/pv/views/tabular_decoder/model.cpp @@ -324,9 +324,9 @@ QModelIndex AnnotationCollectionModel::update_highlighted_rows(QModelIndex first // we would need to highlight - only then do we do so QModelIndex index = first; do { - const Annotation* ann = - static_cast(index.internalPointer()); - assert(ann); + const Annotation* ann = static_cast(index.internalPointer()); + if (!ann) // Can happen if the table is being modified at this exact time + return result; if (((int64_t)ann->start_sample() <= sample_num) && ((int64_t)ann->end_sample() >= sample_num)) { -- 2.30.2