Bug fix: support recordings with no fill attribute

This script is failing for older recordings with no fill attribute. In that case,`event.at_xpath('fill')` is `nil`, failing once `.text` on `nil` is called.
This commit is contained in:
Daniel Petri Rocha 2021-12-14 17:02:19 +01:00 committed by GitHub
parent e14392fb26
commit 14df8d110a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -610,7 +610,8 @@ def events_parse_shape(shapes, event, current_presentation, current_slide, times
end
if shape[:type] == 'rectangle' or
shape[:type] == 'ellipse' or shape[:type] == 'triangle'
fill = event.at_xpath('fill').text
fill = event.at_xpath('fill')
fill = fill.nil? ? "false" : fill.text
shape[:fill] = fill =~ /true/ ? true : false
end
if shape[:type] == 'rectangle'