Skip to content

Commit 02adca4

Browse files
authoredJan 11, 2022
fix: fix exceptions on messages of client side cache (#1479)
when works with the new server assist client side cache feature, redis sends single string "__redis__:invalidate" from server. so reply[2] is null, the update fixes the issue
1 parent 2939f8a commit 02adca4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/DataHandler.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export default class DataHandler {
119119
case "message":
120120
if (this.redis.listeners("message").length > 0) {
121121
// Check if there're listeners to avoid unnecessary `toString()`.
122-
this.redis.emit("message", reply[1].toString(), reply[2].toString());
122+
this.redis.emit("message", reply[1].toString(), reply[2] ? reply[2].toString() : '');
123123
}
124124
this.redis.emit("messageBuffer", reply[1], reply[2]);
125125
break;

0 commit comments

Comments
 (0)
Please sign in to comment.