Fix subscribe-and-send

When not in lurk mode, lurk_stream is undefined which caused
lurk_stream.toLowerCase() to fail.

(imported from commit 63ce79083b55a37cb0455871237a76d724fbbbea)
This commit is contained in:
Reid Barton
2013-01-17 15:35:31 -05:00
parent b8d56433f0
commit 07edc87cb9

View File

@@ -302,7 +302,8 @@ function validate_stream_message() {
// browser window doesn't know it. // browser window doesn't know it.
return true; return true;
case "not-subscribed": case "not-subscribed":
if (lurk_stream.toLowerCase() === stream_name.toLowerCase()) { if (lurk_stream !== undefined &&
lurk_stream.toLowerCase() === stream_name.toLowerCase()) {
// Just subscribe them. // Just subscribe them.
subs.subscribe_for_send(stream_name); subs.subscribe_for_send(stream_name);
// When the subscription request completes, // When the subscription request completes,