--- vdr-1.3.46~/menuitems.c +++ vdr-1.3.46/menuitems.c @@ -36,7 +36,7 @@ void cMenuEditItem::SetValue(const char *Value) { free(value); - value = strdup(Value); + value = Value ? strdup(Value) : NULL; char *buffer = NULL; asprintf(&buffer, "%s:\t%s", name, value); SetText(buffer, false); @@ -615,61 +615,18 @@ } channel = (cChannel *)channel->Next(); } + if (!number) { + // couldn't find the selected channel, or one hasn't yet been chosen; + // default to the first available channel + channel = Channels.First(); + while (channel) { + if (!channel->GroupSep()) { + number = channel->Number(); + break; + } + channel = (cChannel *)channel->Next(); + } + } Set(); }