fixed bug in menu header if title is NULL

This commit is contained in:
louis 2016-02-20 17:55:27 +01:00
parent 6accb0b563
commit 7af7daafc2

View File

@ -49,6 +49,8 @@ void cVeDmHeader::SetTokenContainer(void) {
} }
void cVeDmHeader::SetTitle(const char *title) { void cVeDmHeader::SetTitle(const char *title) {
if (!title)
return;
if (this->title && !strcmp(this->title, title)) if (this->title && !strcmp(this->title, title))
return; return;
free(this->title); free(this->title);
@ -79,12 +81,13 @@ void cVeDmHeader::Set(eMenuCategory menuCat) {
//check for standard menu entries //check for standard menu entries
bool hasIcon = false; bool hasIcon = false;
string icon = imgCache->GetIconName(title, menuCat); if (title) {
if (imgCache->MenuIconExists(icon)) string icon = imgCache->GetIconName(title, menuCat);
hasIcon = true; if (imgCache->MenuIconExists(icon))
hasIcon = true;
tokenContainer->AddStringToken((int)eDMHeaderST::icon, icon.c_str()); tokenContainer->AddStringToken((int)eDMHeaderST::icon, icon.c_str());
tokenContainer->AddIntToken((int)eDMHeaderIT::hasicon, hasIcon); tokenContainer->AddIntToken((int)eDMHeaderIT::hasicon, hasIcon);
}
//Disc Usage //Disc Usage
tokenContainer->AddStringToken((int)eDMHeaderST::vdrusagestring, *cVideoDiskUsage::String()); tokenContainer->AddStringToken((int)eDMHeaderST::vdrusagestring, *cVideoDiskUsage::String());