svndiff.py: properly handle empty expectations dictionary
BUG=skia:1588
R=jvanverth@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11078 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/jsondiff.py b/tools/jsondiff.py
index 76958c6..050a177 100755
--- a/tools/jsondiff.py
+++ b/tools/jsondiff.py
@@ -80,6 +80,12 @@
         result_dict = {}
         json_dict = gm_json.LoadFromString(contents)
         all_expectations = json_dict[gm_json.JSONKEY_EXPECTEDRESULTS]
+
+        # Prevent https://code.google.com/p/skia/issues/detail?id=1588
+        # ('svndiff.py: 'NoneType' object has no attribute 'keys'')
+        if not all_expectations:
+            return result_dict
+
         for test_name in all_expectations.keys():
             test_expectations = all_expectations[test_name]
             allowed_digests = test_expectations[