Fix the build.
authorscroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 24 Apr 2013 19:37:52 +0000 (19:37 +0000)
committerscroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 24 Apr 2013 19:37:52 +0000 (19:37 +0000)
Allow NULL for defaultValue in SkCommandLineFlags.

unreviewed.

Review URL: https://codereview.chromium.org/14472017

git-svn-id: http://skia.googlecode.com/svn/trunk@8847 2bbb7eff-a529-9590-31e7-b0007b416f81

tools/flags/SkCommandLineFlags.cpp

index 7420d26..ed8db8e 100644 (file)
@@ -22,6 +22,9 @@ bool SkFlagInfo::CreateStringFlag(const char* name, const char* shortName,
 void SkFlagInfo::SetDefaultStrings(SkCommandLineFlags::StringArray* pStrings,
                                    const char* defaultValue) {
     pStrings->reset();
+    if (NULL == defaultValue) {
+        return;
+    }
     // If default is "", leave the array empty.
     size_t defaultLength = strlen(defaultValue);
     if (defaultLength > 0) {