Don't typecast invalid (#98)

This commit is contained in:
Nick Bisby 2019-12-08 19:31:07 -06:00 committed by GitHub
parent edab57c45b
commit 819c89c3fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -23,7 +23,7 @@ sub itemContentChanged()
m.top.overhangTitle = itemData.name
setFieldText("releaseYear", itemData.productionYear)
setFieldText("officialRating", itemData.officialRating)
setFieldText("communityRating", str(itemData.communityRating))
setFieldText("communityRating", itemData.communityRating)
setFieldText("overview", itemData.overview)
if type(itemData.RunTimeTicks) = "LongInteger"
@ -61,6 +61,8 @@ sub setFieldText(field, value)
' Handle non strings... Which _shouldn't_ happen, but hey
if type(value) = "roInt" or type(value) = "Integer" then
value = str(value)
else if type(value) = "roFloat" or type(value) = "Float" then
value = str(value)
else if type(value) <> "roString" and type(value) <> "String" then
value = ""
end if

View File

@ -16,7 +16,7 @@ sub itemContentChanged()
m.top.overhangTitle = itemData.name
setFieldText("releaseYear", itemData.productionYear)
setFieldText("officialRating", itemData.officialRating)
setFieldText("communityRating", str(itemData.communityRating))
setFieldText("communityRating", itemData.communityRating)
setFieldText("overview", itemData.overview)
@ -49,6 +49,8 @@ sub setFieldText(field, value)
' Handle non strings... Which _shouldn't_ happen, but hey
if type(value) = "roInt" or type(value) = "Integer" then
value = str(value)
else if type(value) = "roFloat" or type(value) = "Float" then
value = str(value)
else if type(value) <> "roString" and type(value) <> "String" then
value = ""
end if