From: Soeren Apel Date: Sun, 1 Mar 2020 13:43:25 +0000 (+0100) Subject: QHexView: Also check for empty chunk list X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ff49e70c60ba4ea93c5966dd4d415fcd6f6e19fb;p=pulseview.git QHexView: Also check for empty chunk list --- diff --git a/pv/views/decoder_binary/QHexView.cpp b/pv/views/decoder_binary/QHexView.cpp index ccd50f87..cdaf1b5d 100644 --- a/pv/views/decoder_binary/QHexView.cpp +++ b/pv/views/decoder_binary/QHexView.cpp @@ -283,7 +283,7 @@ void QHexView::paintEvent(QPaintEvent *event) // Fill widget background painter.fillRect(event->rect(), palette().color(QPalette::Base)); - if (!data_ || (data_size_ == 0)) { + if (!data_ || (data_size_ == 0) || (data_->chunks.empty())) { painter.setPen(palette().color(QPalette::Text)); QString s = tr("No data available"); int x = (areaSize.width() - fontMetrics().boundingRect(s).width()) / 2;