From e7f92d7549df2f240ef5b95f0617fe98c60a8059 Mon Sep 17 00:00:00 2001 From: louis Date: Fri, 6 Dec 2013 16:37:13 +0100 Subject: fixed a crash for recordings without valid title in info file --- HISTORY | 1 + displayreplay.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/HISTORY b/HISTORY index 5fdedb2..ffa081e 100644 --- a/HISTORY +++ b/HISTORY @@ -388,3 +388,4 @@ Version 1.0.1 - fixed a bug in cImageLoader::FirstImageInFolder() - added more Exception Handling for Image Loading +- fixed a crash for recordings without valid title in info file diff --git a/displayreplay.c b/displayreplay.c index 0f331bb..d7f7045 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -295,7 +295,14 @@ void cNopacityDisplayReplay::DrawScreenResolution(void) { void cNopacityDisplayReplay::SetRecording(const cRecording *Recording) { const cRecordingInfo *RecordingInfo = Recording->Info(); - SetTitle(RecordingInfo->Title()); + const char *recName = RecordingInfo->Title(); + if (!recName) { + recName = Recording->Name(); + } + if (!recName) { + recName = *Recording->BaseName(); + } + SetTitle(recName); cString info2; if (RecordingInfo->ShortText()) info2 = cString::sprintf("%s - %s %s", RecordingInfo->ShortText(), *ShortDateString(Recording->Start()), *TimeString(Recording->Start())); -- cgit v1.2.3