reaby / infoscreen3

info screen for lanparty
MIT License
24 stars 9 forks source link

Changing Background crashed complete Service #26

Closed Hornochs closed 2 years ago

Hornochs commented 2 years ago

Describe the bug Changing the Background in a bundle lett the complete system crash. Tested on both system, Debian 11 and Docker

Latest Lines in Log:

[Info] Memory: ▲ 0.1Mb start: 78.9Mb   now: 73.7Mb   (-5.2Mb)
file:///usr/src/infoscreen/routes/admin.js:95
                if (details.filename.length > 0 && (details.mimeType === "image/jpeg" || details.mimeType === "video/mp4" || details.mimeType === "image/png")) {
                                     ^

TypeError: Cannot read properties of undefined (reading 'length')
    at Multipart.<anonymous> (file:///usr/src/infoscreen/routes/admin.js:95:38)
    at Multipart.emit (node:events:513:28)
    at HeaderParser.cb (/usr/src/infoscreen/node_modules/busboy/lib/types/multipart.js:358:14)
    at HeaderParser.push (/usr/src/infoscreen/node_modules/busboy/lib/types/multipart.js:162:20)
    at SBMH.ssCb [as _cb] (/usr/src/infoscreen/node_modules/busboy/lib/types/multipart.js:394:37)
    at feed (/usr/src/infoscreen/node_modules/streamsearch/lib/sbmh.js:219:14)
    at SBMH.push (/usr/src/infoscreen/node_modules/streamsearch/lib/sbmh.js:104:16)
    at Multipart._write (/usr/src/infoscreen/node_modules/busboy/lib/types/multipart.js:567:19)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)

Node.js v19.0.0

Desktop (please complete the following information):

Hornochs commented 2 years ago

I just tried it with 1.6.0, there does the issue not happen

reaby commented 2 years ago

Sorry for the inconvinience, it's fixed now with a simple null-check. I fixed at somepoint the uploading of the backgrounds, must be side effect+ not testing change of background, but only that the upload works...

Hornochs commented 2 years ago

Thank you very much! The LAN-Party was so stressful that I didn't saw the new commit. I'll test it again and give feedback if anything goes wrong