diff --git a/src/widgets/scrollbar.cpp b/src/widgets/scrollbar.cpp index efde86a1..1acb0eb1 100644 --- a/src/widgets/scrollbar.cpp +++ b/src/widgets/scrollbar.cpp @@ -219,6 +219,11 @@ void Scrollbar::paintEvent(QPaintEvent *) // draw highlights auto snapshot = this->highlights.getSnapshot(); int snapshotLength = (int)snapshot.getLength(); + + if (snapshotLength == 0) { + return; + } + int w = this->width(); float y = 0; float dY = (this->height() - MIN_THUMB_HEIGHT) / snapshotLength;