aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-03-25 17:02:20 -0400
committerGravatar Brian Salomon <bsalomon@google.com>2016-03-25 17:02:20 -0400
commitd2100f20a90cadaad0266ec4c9b337e5487a7421 (patch)
tree3aea2ab41a8a5554bb3165a36ea3ed77ac009515 /tests
parent2176f75b066d630e0b66fb5a7065ecd217150ca4 (diff)
Don't crash when resource path isn't specified
Diffstat (limited to 'tests')
-rw-r--r--tests/ColorSpaceTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ColorSpaceTest.cpp b/tests/ColorSpaceTest.cpp
index 37785e238b..0774a095a7 100644
--- a/tests/ColorSpaceTest.cpp
+++ b/tests/ColorSpaceTest.cpp
@@ -57,9 +57,15 @@ DEF_TEST(ColorSpaceParsePngICCProfile, r) {
DEF_TEST(ColorSpaceParseJpegICCProfile, r) {
SkAutoTDelete<SkStream> stream(resource("icc-v2-gbr.jpg"));
REPORTER_ASSERT(r, nullptr != stream);
+ if (!stream) {
+ return;
+ }
SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream.release()));
REPORTER_ASSERT(r, nullptr != codec);
+ if (!codec) {
+ return;
+ }
SkColorSpace* colorSpace = codec->getColorSpace();
REPORTER_ASSERT(r, nullptr != colorSpace);