Skip to content

Commit b53f91a

Browse files
Check if Keys are Avaiable (#1509)
Otherwise, the value would have been taken null and the code won't progress further.
1 parent ececccc commit b53f91a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

addons/dialogic/Events/Converter/settings_converter.gd

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,11 @@ func convertTimelines():
319319
# Character event
320320

321321
#For some reason this is loading as a float, and the match is failing. so hard casting as string
322-
var eventType:String = str(event['type'])
322+
var eventType:String
323+
if 'type' in event:
324+
eventType = str(event['type'])
325+
else:
326+
eventType = "0"
323327

324328
match eventType:
325329
"0":
@@ -337,7 +341,7 @@ func convertTimelines():
337341
if (event['animation'] != "[Default]" && event['animation'] != "") || ('z_index' in event) || ('mirror_portrait' in event):
338342
# Note: due to Anima changes, animations will be converted into a default. Times and wait will be perserved
339343
eventLine += " ["
340-
if (event['animation'] != "[Default]" && event['animation'] != ""):
344+
if ('animation' in event && event['animation'] != "[Default]" && event['animation'] != ""):
341345
eventLine += " [animation=\"Instant In Or Out\" "
342346
eventLine += "length=\"" + str(event['animation_length']) + "\""
343347
if "animation_wait" in event:

0 commit comments

Comments
 (0)