Skip to content

Commit ef9aed0

Browse files
committed
Closed #166 with a new method of handling over-the-top message #
1 parent 570935f commit ef9aed0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

load/dmbase.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,14 @@ msg_base = {
648648
//is bogus before we waste time with this, especially since the mHdr
649649
//===null tested block doesn't seem to keep horrible things from
650650
//happening with a ptr passed that's way out of range
651-
if ((ptr < 1) || (ptr > base.last_msg)) {
651+
if (ptr < 1) {
652652
//shit's out of range, man
653653
throw new docIface.dDocException("dispMsg() error",
654654
"Invalid message slot", 3);
655+
} else if (ptr > base.last_msg) {
656+
console.putmsg(yellow + "Your message # was over the top; " +
657+
"pointing you at the last message\n");
658+
ptr = base.last_msg;
655659
}
656660

657661
//try/catch this
@@ -661,7 +665,7 @@ msg_base = {
661665
} catch (e) {
662666
console.putmsg(red + "Error fetching mHdr & mBody\nName: " + e.name +
663667
"\tNumber: " + e.number + "\nMessage: " + e.message + "\n");
664-
throw new dDocException("dispMsg() Error",
668+
throw new docIface.dDocException("dispMsg() Error",
665669
"Unable to fetch message header/body", 1);
666670
}
667671

0 commit comments

Comments
 (0)