Skip to content

Commit

Permalink
Fix crash when size.w .h were both null in json
Browse files Browse the repository at this point in the history
  • Loading branch information
Cobrand committed Nov 20, 2016
1 parent 3fa9677 commit 7c3ac56
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/subtitles/sentence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,13 @@ impl From<(SentenceOptions,i32)> for SentenceParameters {
transition_time_after: sentence_options.transition_time_after.unwrap_or(500),
fade_time_after: sentence_options.fade_time_after.unwrap_or(200),
row_position: sentence_options.row_position,
size: sentence_options.size.unwrap_or(Size {
width:Some(0.95),
height:Some(0.09)
})
size: match sentence_options.size {
None | Some( Size { width:None,height:None}) => Size {
width:Some(0.95),
height:Some(0.09)
},
Some(e) => e
}
}
}
}
Expand Down

0 comments on commit 7c3ac56

Please sign in to comment.