Don't crash when Firefox doesn't send autoMargins.

This commit is contained in:
Michael Howell 2015-07-14 20:57:41 -07:00
parent 9af229b830
commit 602c8bb415

View file

@ -459,7 +459,8 @@ impl Actor for PageStyleActor {
.unwrap(); .unwrap();
let (width, height) = rx.recv().unwrap(); let (width, height) = rx.recv().unwrap();
let auto_margins = msg.get(&"autoMargins".to_string()).unwrap().as_boolean().unwrap(); let auto_margins = msg.get(&"autoMargins".to_string())
.and_then(&Json::as_boolean).unwrap_or(false);
//TODO: the remaining layout properties (margin, border, padding, position) //TODO: the remaining layout properties (margin, border, padding, position)
// as specified in getLayout in // as specified in getLayout in