From 4a071946ba2b5fe85eb8e958961ffbb10240e883 Mon Sep 17 00:00:00 2001 From: Marc Krenn Date: Mon, 20 Nov 2017 09:34:41 +0100 Subject: [PATCH] handle undefined & null --- firebase.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firebase.coffee b/firebase.coffee index 4d2f7fa..b46ea64 100644 --- a/firebase.coffee +++ b/firebase.coffee @@ -61,7 +61,7 @@ class exports.Firebase extends Framer.BaseClass when 2 then console.log "Firebase: Request received \n URL: '#{url}'" if debug when 3 then console.log "Firebase: Processing request \n URL: '#{url}'" if debug when 4 - unless xhttp.responseText is null + if xhttp.responseText? callback(JSON.parse(xhttp.responseText)) if callback? console.log "Firebase: Request finished, response: '#{JSON.parse(xhttp.responseText)}' \n URL: '#{url}'" if debug else