nedap server: gracefully handle missing backend

This commit is contained in:
Astro 2011-10-14 21:15:45 +02:00
parent 9774738066
commit 4bf35a0dbd

View File

@ -44,6 +44,7 @@ var updateBackendTimeout;
function updateBackend() { function updateBackend() {
if (!updateBackendTimeout) { if (!updateBackendTimeout) {
updateBackendTimeout = setTimeout(function() { updateBackendTimeout = setTimeout(function() {
if (backend)
backend.sendUTF(JSON.stringify({ scores: scores })); backend.sendUTF(JSON.stringify({ scores: scores }));
updateBackendTimeout = undefined; updateBackendTimeout = undefined;
}, 50); }, 50);