File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ And then call `npm run build`.
38
38
39
39
## Changelog
40
40
41
+ ### __ WORK IN PROGRESS__
42
+ * (Apollon77) Handle more cases with invalid script names/state-ids (Sentry IOBROKER-JAVASCRIPT-5W)
43
+
41
44
### 4.10.14 (2021-01-25)
42
45
* (Apollon77) Handle more cases with invalid script names/state-ids (Sentry IOBROKER-JAVASCRIPT-5R)
43
46
Original file line number Diff line number Diff line change @@ -1701,11 +1701,13 @@ function prepareScript(obj, callback) {
1701
1701
if ( obj && obj . _id ) {
1702
1702
_name = obj . _id ;
1703
1703
const scriptIdName = _name . substring ( 'script.js.' . length ) ;
1704
- if ( scriptIdName . length ) {
1705
- adapter . setState ( 'scriptEnabled.' + scriptIdName , false , true ) ;
1706
- } else {
1707
- adapter . log . error ( 'Invalid scriptname' ) ;
1704
+
1705
+ if ( ! scriptIdName . length || scriptIdName . endsWith ( '.' ) ) {
1706
+ adapter . log . error ( `Script name ${ _name } is invalid!` ) ;
1707
+ typeof callback === 'function' && callback ( false , _name ) ;
1708
+ return ;
1708
1709
}
1710
+ adapter . setState ( 'scriptEnabled.' + scriptIdName , false , true ) ;
1709
1711
}
1710
1712
! obj && adapter . log . error ( 'Invalid script' ) ;
1711
1713
typeof callback === 'function' && callback ( false , _name ) ;
You can’t perform that action at this time.
0 commit comments