Fished crash on null value

master
Mark Moffat 2020-01-07 21:10:22 +10:30
parent c4ffdff19e
commit a880c0078f
1 changed files with 6 additions and 3 deletions

9
app.js
View File

@ -287,9 +287,12 @@ handlebars = handlebars.create({
return'';
},
upperFirst: (value) => {
return value.replace(/^\w/, (chr) => {
return chr.toUpperCase();
});
if(value){
return value.replace(/^\w/, (chr) => {
return chr.toUpperCase();
});
}
return value;
},
math: (lvalue, operator, rvalue, options) => {
lvalue = parseFloat(lvalue);