🐛 Fix files with no dimensions breaking the files UI
I had a response like
```
"date": 1614624977,
"display": "Misc_-_Happy_Birthday_1.gcode",
"gcodeAnalysis": {
"analysisPending": false
},
"hash": "20af558d1fc68865333892cd9d0536293120e3b7",
"name": "Misc_-_Happy_Birthday_1.gcode",
"origin": "local",
"path": "Misc_-_Happy_Birthday_1.gcode",
```
Can't go 3 levels deep in JS without checking that the object exists, which apparently in some cases it doesn't.
This commit is contained in:
1 parent
f63f177c78
commit
c355318f1a
1 file changed
+2
-1
@@ -967,7 +967,8 @@ $(function () {
|
||||
if (data["gcodeAnalysis"]) {
|
||||
if (
|
||||
data["gcodeAnalysis"]["_empty"] ||
|
||||
(data["gcodeAnalysis"]["dimensions"]["width"] === 0 &&
|
||||
(data["gcodeAnalysis"]["dimensions"] &&
|
||||
data["gcodeAnalysis"]["dimensions"]["width"] === 0 &&
|
||||
data["gcodeAnalysis"]["dimensions"]["depth"] === 0 &&
|
||||
data["gcodeAnalysis"]["dimensions"]["height"] === 0)
|
||||
) {
|
||||
|
||||
Reference in new issue
Block a user