Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3488)

Unified Diff: dm/DMJsonWriter.cpp

Issue 1067863002: Fix DM -r (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMJsonWriter.cpp
diff --git a/dm/DMJsonWriter.cpp b/dm/DMJsonWriter.cpp
index 4fe692432794c93e8f93f9312cb12d25f050c033..04ae2cea8ac4144591bfb404f81f640116c68f25 100644
--- a/dm/DMJsonWriter.cpp
+++ b/dm/DMJsonWriter.cpp
@@ -110,12 +110,15 @@ bool JsonWriter::ReadJson(const char* path, void(*callback)(BitmapResult)) {
BitmapResult br;
for (unsigned i = 0; i < results.size(); i++) {
const Json::Value& r = results[i];
- br.name = r["key"]["name"].asCString();
- br.config = r["key"]["config"].asCString();
- br.sourceType = r["key"]["source_type"].asCString();
- br.sourceOptions = r["key"]["source_options"].asCString();
- br.ext = r["options"]["ext"].asCString();
- br.md5 = r["md5"].asCString();
+ br.name = r["key"]["name"].asCString();
+ br.config = r["key"]["config"].asCString();
+ br.sourceType = r["key"]["source_type"].asCString();
+ br.ext = r["options"]["ext"].asCString();
+ br.md5 = r["md5"].asCString();
+
+ if (!r["key"]["source_options"].isNull()) {
+ br.sourceOptions = r["key"]["source_options"].asCString();
+ }
callback(br);
}
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698