NodeRED becomes unresponsive at uncaught exception

I run emoncms and NodeRed on an Amazon Web Services Ubuntu server. I created a flow that goes to a Gmail account, gets an email from my water utility company with my water usage, extracts the gallon value, and forwards the result to emoncms. It works when I deploy it, but the next day when it collects the next daily usage email, NodeRed becomes unresponsive. It disconnects me if I am logged in, and gives a “this site can’t be reached” error when I try to navigate to the admin page. I’m pasting in the function and the error below hoping someone can help me.

try {
var startpos =“usage of “)+8;
var endpos =” G exceeded”);
var gal = { payload: msg.html.substring(startpos,endpos) };
return [msg, gal]
} catch(e) {
node.error(“hit an error”, e);

Jun 15:07:37 - [info] [e-mail in:baldockemon] message #21
> Fetch message - msg={“domain”:null,"_events":{},"_eventsCount":0}, seqno=21
> message - body - stream=?, info={“seqno”:21,“which”:“TEXT”,“size”:526}
> stream - data - chunk=??
> stream - data - chunk=??
> message - body - stream=?, info={“seqno”:21,“which”:“HEADER”,“size”:3351}
> stream - data - chunk=??
> stream - data - chunk=??
> stream - data - chunk=??
> stream - data - chunk=??
> stream - data - chunk=??
> msg - end : “html formatted message here, but the forum won’t let me post it because it says new users can’t post more than two links”
6 Jun 15:07:38 - [red] Uncaught Exception:
6 Jun 15:07:38 - TypeError: Cannot read property ‘fullcmd’ of undefined
at Connection._resUntagged (/usr/lib/node_modules/node-red/node_modules/node-red-node-email/node_modules/imap/lib/Connection.js:1403:44)
at Parser. (/usr/lib/node_modules/node-red/node_modules/node-red-node-email/node_modules/imap/lib/Connection.js:190:10)
at emitOne (events.js:77:13)
at Parser.emit (events.js:169:7)
at Parser._resUntagged (/usr/lib/node_modules/node-red/node_modules/node-red-node-email/node_modules/imap/lib/Parser.js:271:10)
at Parser._parse (/usr/lib/node_modules/node-red/node_modules/node-red-node-email/node_modules/imap/lib/Parser.js:137:16)
at Parser._tryread (/usr/lib/node_modules/node-red/node_modules/node-red-node-email/node_modules/imap/lib/Parser.js:82:15)
at TLSSocket.Parser._cbReadable (/usr/lib/node_modules/node-red/node_modules/node-red-node-email/node_modules/imap/lib/Parser.js:53:12)
at emitNone (events.js:67:13)
at TLSSocket.emit (events.js:166:7)

You may get a better response in the node-red forum.