From 900b1a3e14b69d8c74f5a584d9e9ae4f829909b6 Mon Sep 17 00:00:00 2001 From: Karliss Date: Fri, 3 Nov 2023 20:46:44 +0200 Subject: [PATCH] Fix decompiler widget crash when starting unsynced --- src/widgets/DecompilerWidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widgets/DecompilerWidget.cpp b/src/widgets/DecompilerWidget.cpp index c54ad6f9..b00c0ccd 100644 --- a/src/widgets/DecompilerWidget.cpp +++ b/src/widgets/DecompilerWidget.cpp @@ -347,8 +347,10 @@ void DecompilerWidget::decompilationFinished(RzAnnotatedCode *codeDecompiled) } } - ui->textEdit->horizontalScrollBar()->setSliderPosition(scrollHistory[historyPos].first); - ui->textEdit->verticalScrollBar()->setSliderPosition(scrollHistory[historyPos].second); + if (!scrollHistory.empty()) { + ui->textEdit->horizontalScrollBar()->setSliderPosition(scrollHistory[historyPos].first); + ui->textEdit->verticalScrollBar()->setSliderPosition(scrollHistory[historyPos].second); + } } void DecompilerWidget::setAnnotationsAtCursor(size_t pos)