Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on empty config entry #15

Open
josswright opened this issue May 30, 2017 · 1 comment
Open

Crash on empty config entry #15

josswright opened this issue May 30, 2017 · 1 comment

Comments

@josswright
Copy link

I just installed this, and created a JSON config file as mentioned in the README.

As I had no need for an 'onNotifyPost' entry, I initially left it empty:
exports.onNotifyPost = "";

That crashed with:

/usr/lib/node_modules/imapnotify/node_modules/printf/lib/printf.js:31
content = str.slice(lastIndex);
               ^
TypeError: Cannot read property 'slice' of undefined
at tokenize (/usr/lib/node_modules/imapnotify/node_modules/printf/lib/printf.js:31:16)
at new Formatter (/usr/lib/node_modules/imapnotify/node_modules/printf/lib/printf.js:41:18)
at module.exports (/usr/lib/node_modules/imapnotify/node_modules/printf/lib/printf.js:459:19)
at notify (/usr/lib/node_modules/imapnotify/bin/imapnotify:241:21)
at Connection.<anonymous> (/usr/lib/node_modules/imapnotify/bin/imapnotify:66:11)
at emitOne (events.js:96:13)
at Connection.emit (events.js:191:7)
at Connection._resUntagged (/usr/lib/node_modules/imapnotify/node_modules/imap/lib/Connection.js:1287:14)
at Parser.<anonymous> (/usr/lib/node_modules/imapnotify/node_modules/imap/lib/Connection.js:191:10)
at emitOne (events.js:96:13)`

The same happened if I simply commented that line out of the config.

I've currently fixed it simply by putting /usr/bin/true in the onNotifyPost export, but this should probably be handled!

@a-sk
Copy link
Owner

a-sk commented Jun 19, 2017

Thank you for reporting the issue.
I don't really have time right now to fix the issue, but patches are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants