From 2bfd466da17cf2ba4dc29789c5a62d0649767f89 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Thu, 20 Jul 2023 19:33:59 -0500 Subject: [PATCH] Fix crash that happened after switching from an invalid to valid OpenLP host --- src/slideview.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slideview.cpp b/src/slideview.cpp index 152f995..50bf870 100644 --- a/src/slideview.cpp +++ b/src/slideview.cpp @@ -59,8 +59,11 @@ void SlideView::pollUpdate(QString const&songName, int slide) { } void SlideView::changeSong(int song) { - auto songItem = m_songSelector->item(song); - if (songItem->text() != m_currentSong) { + if (song < 0) { + return; + } + auto const songItem = m_songSelector->item(song); + if (songItem && songItem->text() != m_currentSong) { emit songChanged(song); } }