Skip to content

Commit

Permalink
Merge pull request #1859 from cewert/fix-listposter-crash
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert authored Jul 24, 2024
2 parents 6b6989a + 9875727 commit 1114ec1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions components/ListPoster.bs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ sub init()

m.backdrop = m.top.findNode("backdrop")

' Randmomise the background colors
posterBackgrounds = m.global.constants.poster_bg_pallet
m.backdrop.color = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
' Randomize the background colors
backdropColor = "#00a4db" ' set default in case global var is invalid
localGlobal = m.global

if isValid(localGlobal) and isValid(localGlobal.constants) and isValid(localGlobal.constants.poster_bg_pallet)
posterBackgrounds = localGlobal.constants.poster_bg_pallet
backdropColor = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
end if

m.backdrop.color = backdropColor
updateSize()
end sub

Expand Down

0 comments on commit 1114ec1

Please sign in to comment.