File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,16 @@ class Crypt {
88 }
99
1010 encrypt ( text ) {
11+ let textToEncrypt = text ;
1112 try {
13+ if ( typeof textToEncrypt === 'number' )
14+ textToEncrypt = textToEncrypt . toString ( ) ;
1215 const cipher = crypto . createCipheriv (
1316 'aes-256-cbc' ,
1417 Buffer . from ( this . getKey ( ) ) ,
1518 this . getIv ( )
1619 ) ;
17- let encrypted = cipher . update ( text ) ;
20+ let encrypted = cipher . update ( textToEncrypt ) ;
1821 encrypted = Buffer . concat ( [ encrypted , cipher . final ( ) ] ) ;
1922 return {
2023 iv : this . getIv ( ) . toString ( 'hex' ) ,
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ class Master {
163163 async pushNewJob ( payload ) {
164164 return new Promise ( ( resolve , reject ) => {
165165 if ( typeof payload === 'undefined' ) {
166- this . log . fatal ( 'pushNewJob:' , 'payload is undefined' ) ;
166+ this . log . warn ( 'pushNewJob:' , 'payload is undefined' ) ;
167167 reject ( Error ( 'payload is undefined' ) ) ;
168168 }
169169 let payloadJson = payload ;
You can’t perform that action at this time.
0 commit comments