diff options
Diffstat (limited to 'src/webview/lib/RecipeWebview.js')
-rw-r--r-- | src/webview/lib/RecipeWebview.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/webview/lib/RecipeWebview.js b/src/webview/lib/RecipeWebview.js index 859f7787f..74d05fc2d 100644 --- a/src/webview/lib/RecipeWebview.js +++ b/src/webview/lib/RecipeWebview.js | |||
@@ -42,9 +42,15 @@ class RecipeWebview { | |||
42 | if (this.countCache.direct === direct | 42 | if (this.countCache.direct === direct |
43 | && this.countCache.indirect === indirect) return; | 43 | && this.countCache.indirect === indirect) return; |
44 | 44 | ||
45 | // Parse number to integer | ||
46 | // This will correct errors that recipes may introduce, e.g. | ||
47 | // by sending a String instead of an integer | ||
48 | const directInt = parseInt(direct, 10); | ||
49 | const indirectInt = parseInt(indirect, 10); | ||
50 | |||
45 | const count = { | 51 | const count = { |
46 | direct: direct > 0 ? direct : 0, | 52 | direct: directInt > 0 ? directInt : 0, |
47 | indirect: indirect > 0 ? indirect : 0, | 53 | indirect: indirectInt > 0 ? indirectInt : 0, |
48 | }; | 54 | }; |
49 | 55 | ||
50 | 56 | ||