Merge pull request #692 from suttridge/develop

Contribution: Fixed bug : null object value when targetNode.value is undefined, thus causing all trading to stop.
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-03-18 15:27:29 +01:00
commit faeeb398f0
1 file changed
+7 -6
@@ -195,12 +195,13 @@ exports.newSuperalgosBotModulesTradingRecords = function (processIndex) {
from its value property.
*/
value = targetNode.value
if (recordProperty.config.decimals !== undefined) {
try {
value = Number(value.toFixed(recordProperty.config.decimals))
} catch (err) {
badDefinitionUnhandledException(err, 'Error applying configured decimals.', product, recordProperty)
if (value !== undefined) {
if (recordProperty.config.decimals !== undefined) {
try {
value = Number(value.toFixed(recordProperty.config.decimals))
} catch (err) {
badDefinitionUnhandledException(err, 'Error applying configured decimals.', product, recordProperty)
}
}
}
} else {