MagicMirrorOrg / MagicMirror

MagicMirror² is an open source modular smart mirror platform. With a growing list of installable modules, the MagicMirror² allows you to convert your hallway or bathroom mirror into your personal assistant.
http://magicmirror.builders
MIT License
19.33k stars 4.15k forks source link

Fix crash possibility if `module: <name>` is not defined and on mistake `position: <position>` #3445

Open bugsounet opened 3 weeks ago

bugsounet commented 3 weeks ago

Fix #3442

KristjanESPERANTO commented 2 weeks ago

Just a thought: Wouldn't that be a thing that belongs in check_config.js?

sdetweil commented 2 weeks ago

yes, also.

bugsounet commented 2 weeks ago

check_config.js check only syntax but it does not check the contents of the file

should we make some other checks on it too ?

sdetweil commented 2 weeks ago

well, this one is the first actual content that is important.. altho position should be checked too.. at least valid if specified.. that is another crash..

the user that reporteds the split problem said they ran config:check but it was good..

bugsounet commented 2 weeks ago

So, we have to check module: <name>and position: <valid position> (if defined)

we check it on check_config.js and MM core ?

Personally, I think it's essential to apply the rules to both

sdetweil commented 2 weeks ago

I think so.. never crash..

bugsounet commented 2 weeks ago

ok, I will see to code it

bugsounet commented 2 weeks ago

Right, I will try to add needed rules with eslint in check_config.js ;)

I have never done this kind of test. bugsounet, it's time to learn :)

bugsounet commented 2 weeks ago

module name error: image

position error: image

No error: image

I'm not sure that i can integrate it into eslint

What do you think @sdetweil ?

bugsounet commented 21 hours ago

Before approuve some new deps. Thanks to review this :>