From 3ee8ef9e0ab716dd208fe69d74b1ecf99f9cfeed Mon Sep 17 00:00:00 2001 From: wiidev Date: Sat, 7 Jan 2023 23:30:02 +0000 Subject: [PATCH] Handle unknown titles correctly --- source/Channels/channels.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/Channels/channels.cpp b/source/Channels/channels.cpp index e1c8d4ee..c498ef83 100755 --- a/source/Channels/channels.cpp +++ b/source/Channels/channels.cpp @@ -129,7 +129,12 @@ void Channels::InternalGetNandChannelList(u32 type) if (tid == 0x000100014c554c5aLL || tid == 0x00010001AF1BF516LL || tid == 0x0001000148415858LL) strcpy(id, "JODI"); - std::string TitleName(NandTitles.NameOf(tid)); + const char *name = NandTitles.NameOf(tid); + std::string TitleName; + if (!name || *name == '\0') + TitleName.assign(id); + else + TitleName.assign(name); TitleName.erase(0, TitleName.find_first_not_of(' ')); int s = NandChannels.size();