Skip to content

Commit

Permalink
Don't add a number to undefined, which will give us NaN, which will J…
Browse files Browse the repository at this point in the history
…SON.stringify to null
  • Loading branch information
justvanrossum committed Dec 1, 2023
1 parent 3a9d6c2 commit ee450f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fontra/views/editor/panel-selection-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,8 @@ function applyNewValue(glyph, layerInfo, changePath, value, field, absolute) {
return recordChanges(glyph, (glyph) => {
const layers = glyph.layers;
for (const { layerName, orgValue } of layerInfo) {
let newValue = delta === null ? value : orgValue + delta;
let newValue =
delta === null || orgValue === undefined ? value : orgValue + delta;
if (isNumber) {
newValue = maybeClampValue(newValue, field.minValue, field.maxValue);
}
Expand Down

0 comments on commit ee450f9

Please sign in to comment.