Commit a2358c0e authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] FileField gadget should not crash if no file is uploaded

parent 3c850c3a
...@@ -137,6 +137,9 @@ ...@@ -137,6 +137,9 @@
var gadget = this,\n var gadget = this,\n
input = gadget.element.querySelector(\'input\'),\n input = gadget.element.querySelector(\'input\'),\n
file = input.files[0];\n file = input.files[0];\n
if (file === undefined) {\n
return {};\n
}\n
return new RSVP.Queue()\n return new RSVP.Queue()\n
.push(function () {\n .push(function () {\n
return jIO.util.readBlobAsDataURL(file);\n return jIO.util.readBlobAsDataURL(file);\n
...@@ -287,7 +290,7 @@ ...@@ -287,7 +290,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>948.40339.11731.59255</string> </value> <value> <string>948.41920.59644.21196</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -305,7 +308,7 @@ ...@@ -305,7 +308,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1453389723.25</float> <float>1453476561.59</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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