ensure vars are valid - fixes crashlog line 516

This commit is contained in:
Charles Ewert 2023-03-02 13:33:54 -05:00
parent a39f52cd51
commit 742c60b910

View File

@ -567,15 +567,18 @@ sub Main (args as dynamic) as void
end if end if
else if type(msg) = "roDeviceInfoEvent" else if type(msg) = "roDeviceInfoEvent"
event = msg.GetInfo() event = msg.GetInfo()
group = sceneManager.callFunc("getActiveScene")
if event.exitedScreensaver = true if event.exitedScreensaver = true
sceneManager.callFunc("resetTime") sceneManager.callFunc("resetTime")
if group.subtype() = "Home" group = sceneManager.callFunc("getActiveScene")
currentTime = CreateObject("roDateTime").AsSeconds() if isValid(group?.subtype())
group.timeLastRefresh = currentTime if group.subtype() = "Home"
group.callFunc("refresh") currentTime = CreateObject("roDateTime").AsSeconds()
group.timeLastRefresh = currentTime
group.callFunc("refresh")
end if
' todo: add other screens to be refreshed - movie detail, tv series, episode list etc.
end if end if
' todo: add other screens to be refreshed - movie detail, tv series, episode list etc.
else else
print "Unhandled roDeviceInfoEvent:" print "Unhandled roDeviceInfoEvent:"
print msg.GetInfo() print msg.GetInfo()