fix display of fiddles that DON'T have compile errors
BUG=skia:
Review URL: https://codereview.chromium.org/644253003
diff --git a/experimental/webtry/res/js/webtry.js b/experimental/webtry/res/js/webtry.js
index 8bce06b..18190e9 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 34aa47e..2096f7d 100644
--- a/experimental/webtry/webtry.go
+++ b/experimental/webtry/webtry.go
@@ -937,9 +937,8 @@
}
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 {