reaby/infoscreen3

Changing Background crashed complete Service

Closed this issue · 3 comments

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):

  • OS: Linux
  • Browser: Firefox
  • Infoscreen Version: 1.6.2

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

reaby commented

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...

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