fix display of fiddles that DON'T have compile errors

BUG=skia:

Review URL: https://codereview.chromium.org/644253003
This commit is contained in:
Greg Humphreys 2014-10-16 14:23:02 -04:00
parent 5bb9700b7e
commit c9df8ce821
2 changed files with 3 additions and 4 deletions

View File

@ -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];

View File

@ -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 {