Merge pull request #751 from jimdogx/fix/jf-crash-live-tv-no-favorites

Fix to crash
This commit is contained in:
Jimi 2022-08-25 16:02:06 -06:00 committed by GitHub
commit 38e2a21c71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,6 +80,11 @@ end sub
' When LoadScheduleTask completes (initial or more data) and we have a schedule to display
sub onScheduleLoaded()
' make sure we actually have a schedule (i.e. filter by favorites, but no channels have been favorited)
if m.scheduleGrid.content.GetChildCount() <= 0
return
end if
for each item in m.LoadScheduleTask.schedule
channel = m.scheduleGrid.content.GetChild(m.channelIndex[item.ChannelId])
@ -101,12 +106,19 @@ end sub
sub onProgramFocused()
m.top.watchChannel = invalid
channel = m.scheduleGrid.content.GetChild(m.scheduleGrid.programFocusedDetails.focusChannelIndex)
' Make sure we have channels (i.e. filter set to favorite yet there are none)
if m.scheduleGrid.content.getChildCount() <= 0
channel = invalid
else
channel = m.scheduleGrid.content.GetChild(m.scheduleGrid.programFocusedDetails.focusChannelIndex)
end if
m.detailsPane.channel = channel
m.top.focusedChannel = channel
' Exit if Channels not yet loaded
if channel.getChildCount() = 0
if channel = invalid or channel.getChildCount() = 0
m.detailsPane.programDetails = invalid
return
end if