Commit b8e16bbb authored by Jérome Perrin's avatar Jérome Perrin

Make sure number properties are not Nan

parent 03138c19
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
prefixed_property_id = prefix + property.id; prefixed_property_id = prefix + property.id;
property_element = $("#" + prefixed_property_id); property_element = $("#" + prefixed_property_id);
data[property.id] = property_element.val(); data[property.id] = property_element.val();
if (property.type === "number") { if (property.type === "number" && data[property.id] !== "") {
data[property.id] = parseFloat(data[property.id]) data[property.id] = parseFloat(data[property.id])
} }
} else if (property._class === "Dream.PropertyList") { } else if (property._class === "Dream.PropertyList") {
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
if (property._class === "Dream.Property") { if (property._class === "Dream.Property") {
prefixed_property_id = prefix + property.id; prefixed_property_id = prefix + property.id;
properties[property.id] = $("#" + prefixed_property_id).val(); properties[property.id] = $("#" + prefixed_property_id).val();
if (property.type === "number") { if (property.type === "number" && properties[property.id] !== "") {
properties[property.id] = parseFloat(properties[property.id]) properties[property.id] = parseFloat(properties[property.id])
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment