From 9739d7cf2b4ac86c2d1e23c8f1aa6f029b9a3964 Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Wed, 9 May 2018 10:17:35 -0400 Subject: [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 Commit-Queue: Florin Malita --- experimental/skottie/SkottieJson.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'experimental') 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 writer(buf); - fValue->Accept(writer); + if (fValue) { + rapidjson::PrettyWriter writer(buf); + fValue->Accept(writer); + } return SkString(buf.GetString()); #else -- cgit v1.2.3