From 692e9c3b9bcf0f6f0737ade83288678164a5be73 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 15 Jun 2021 18:42:28 +0200 Subject: [PATCH] lcd4linux.cpp: avoid possible crash if getLiveFE() returns NULL Watched with generic build for pc without tuner hardware. --- src/driver/lcd4l.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/driver/lcd4l.cpp b/src/driver/lcd4l.cpp index 3e5539769..ab639771c 100644 --- a/src/driver/lcd4l.cpp +++ b/src/driver/lcd4l.cpp @@ -533,14 +533,16 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) /* ----------------------------------------------------------------- */ - int Tuner = 1 + CFEManager::getInstance()->getLiveFE()->getNumber(); - - if (m_Tuner != Tuner) + if (CFEManager::getInstance()->getLiveFE()) { - WriteFile(TUNER, to_string(Tuner)); - m_Tuner = Tuner; - } + int Tuner = 1 + CFEManager::getInstance()->getLiveFE()->getNumber(); + if (m_Tuner != Tuner) + { + WriteFile(TUNER, to_string(Tuner)); + m_Tuner = Tuner; + } + } /* ----------------------------------------------------------------- */ int Volume = g_settings.current_volume;