From c9df8ce8212448a9d33b57d266a0aef5c28a98e9 Mon Sep 17 00:00:00 2001 From: Greg Humphreys Date: Thu, 16 Oct 2014 14:23:02 -0400 Subject: [PATCH] fix display of fiddles that DON'T have compile errors BUG=skia: Review URL: https://codereview.chromium.org/644253003 --- experimental/webtry/res/js/webtry.js | 2 +- experimental/webtry/webtry.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/experimental/webtry/res/js/webtry.js b/experimental/webtry/res/js/webtry.js index 8bce06bfd7..18190e92cb 100644 --- a/experimental/webtry/res/js/webtry.js +++ b/experimental/webtry/res/js/webtry.js @@ -269,7 +269,7 @@ // image to display. endWait(); body = JSON.parse(e.target.response); - if (body.compileErrors.length) { + if (null != body.compileErrors && body.compileErrors.length) { html = ""; for (i = 0 ; i < body.compileErrors.length ; i++) { compileError = body.compileErrors[i]; diff --git a/experimental/webtry/webtry.go b/experimental/webtry/webtry.go index 34aa47e282..2096f7d778 100644 --- a/experimental/webtry/webtry.go +++ b/experimental/webtry/webtry.go @@ -937,9 +937,8 @@ func mainHandler(w http.ResponseWriter, r *http.Request) { } m := response{ - Message: message, - Img: base64.StdEncoding.EncodeToString([]byte(png)), - Hash: hash, + Img: base64.StdEncoding.EncodeToString([]byte(png)), + Hash: hash, } resp, err := json.Marshal(m) if err != nil {