Prevent panic during grid-template serialization

This commit is contained in:
Nazım Can Altınova 2017-07-17 23:14:39 -07:00
parent 1b6d29e319
commit 46780ceb0d

View file

@ -374,7 +374,10 @@
Either::First(ref areas) => {
let track_list = match *template_rows {
GenericGridTemplateComponent::TrackList(ref list) => list,
_ => unreachable!(), // should exist!
// Others template components shouldn't exist with normal shorthand values.
// But if we need to serialize a group of longhand sub-properties for
// the shorthand, we should be able to return empty string instead of crashing.
_ => return Ok(()),
};
let mut names_iter = track_list.line_names.iter();