diff --git a/src/EditProfileDialog.cpp b/src/EditProfileDialog.cpp index 9bf42fb92..1f03b3ad0 100644 --- a/src/EditProfileDialog.cpp +++ b/src/EditProfileDialog.cpp @@ -730,11 +730,12 @@ void EditProfileDialog::colorSchemeSelected() if (!selected.isEmpty()) { QAbstractItemModel* model = _ui->colorSchemeList->model(); const ColorScheme* colors = model->data(selected.first(), Qt::UserRole + 1).value(); + if (colors) { + updateTempProfileProperty(Profile::ColorScheme, colors->name()); + previewColorScheme(selected.first()); - updateTempProfileProperty(Profile::ColorScheme, colors->name()); - previewColorScheme(selected.first()); - - updateTransparencyWarning(); + updateTransparencyWarning(); + } } updateColorSchemeButtons(); @@ -839,7 +840,9 @@ void EditProfileDialog::keyBindingSelected() QAbstractItemModel* model = _ui->keyBindingList->model(); const KeyboardTranslator* translator = model->data(selected.first(), Qt::UserRole + 1) .value(); - updateTempProfileProperty(Profile::KeyBindings, translator->name()); + if (translator) { + updateTempProfileProperty(Profile::KeyBindings, translator->name()); + } } updateKeyBindingsButtons(); @@ -1251,8 +1254,9 @@ void ColorSchemeViewDelegate::paint(QPainter* painter, const QStyleOptionViewIte const QModelIndex& index) const { const ColorScheme* scheme = index.data(Qt::UserRole + 1).value(); - Q_ASSERT(scheme); + if (!scheme) + return; bool transparencyAvailable = KWindowSystem::compositingActive(); diff --git a/src/SessionController.cpp b/src/SessionController.cpp index 9c85f3014..e52952c94 100644 --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -1896,7 +1896,6 @@ void SearchHistoryTask::executeOnScreenWindow(SessionPtr session , ScreenWindowP // line number search below assumes that the buffer ends with a new-line string.append('\n'); - pos = -1; if (forwards) pos = string.indexOf(_regExp); else