manual fixes

This commit is contained in:
Thomas Grainger 2017-04-13 18:31:26 +01:00
parent b33f73ac9a
commit d05543db30
No known key found for this signature in database
GPG key ID: 995EA0A029283160
16 changed files with 57 additions and 37 deletions

View file

@ -63,6 +63,7 @@ Ingredient.prototype.setValue = function(value) {
* @param {string} type - The name of the data type.
*/
Ingredient.prepare = function(data, type) {
let number;
switch (type) {
case "binaryString":
case "binaryShortString":
@ -76,7 +77,7 @@ Ingredient.prepare = function(data, type) {
return data;
}
case "number":
var number = parseFloat(data);
number = parseFloat(data);
if (isNaN(number)) {
const sample = Utils.truncate(data.toString(), 10);
throw "Invalid ingredient value. Not a number: " + sample;