Fix 'undefined is not an object' traceback with update_active_status.

This seems to only happen with Firefox for some reason.  We've had
similar issues with other ajax endpoints, so this is probably not the
long-term solution, but I'd like to get this traceback fixed now.

(imported from commit aa552fb56882ae2c73e352c7baf9532a88c5cf0a)
This commit is contained in:
Tim Abbott
2013-06-12 13:58:25 -04:00
parent 34904c51a3
commit a0bdefb71d

View File

@@ -96,6 +96,13 @@ function focus_ping() {
}
$.post('/json/update_active_status', {status: ACTIVE}, function (data) {
if (data === undefined || data.presences === undefined) {
// We sometimes receive no data even on successful
// requests; we should figure out why but this will
// prevent us from throwing errors until then
return;
}
user_info = {};
// Update Zephyr mirror activity warning