aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-05-09 10:17:35 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-09 14:42:45 +0000
commit9739d7cf2b4ac86c2d1e23c8f1aa6f029b9a3964 (patch)
tree4369d7283f024b911493d8b46173ea3bac60888d /experimental
parent1b6b4c5392d9ecd2057ec85084a0804335ebbda7 (diff)
[skottie] Null value crash in json::ValueRef::toString()
Bug: skia:7935 Change-Id: Ibe99ccbf5b8dcf889a71acf1fb52063001fd7612 Reviewed-on: https://skia-review.googlesource.com/126923 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'experimental')
-rw-r--r--experimental/skottie/SkottieJson.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/experimental/skottie/SkottieJson.cpp b/experimental/skottie/SkottieJson.cpp
index 15d86c4ef0..5d00f19f2b 100644
--- a/experimental/skottie/SkottieJson.cpp
+++ b/experimental/skottie/SkottieJson.cpp
@@ -206,8 +206,10 @@ const rapidjson::Value* ValueRef::end() const {
SkString json::ValueRef::toString() const {
#ifdef SK_DEBUG
rapidjson::StringBuffer buf;
- rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(buf);
- fValue->Accept(writer);
+ if (fValue) {
+ rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(buf);
+ fValue->Accept(writer);
+ }
return SkString(buf.GetString());
#else