]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Work around an issue with older diffs in the Facebook database.
authorepriestley <epriestley@javelinjs.com>
Mon, 10 Jan 2011 22:15:08 +0000 (14:15 -0800)
committerepriestley <epriestley@javelinjs.com>
Mon, 10 Jan 2011 22:15:08 +0000 (14:15 -0800)
Summary: We have some diffs which predate property tracking and are shipping
down sketch data, work around it in the client for now.

Test Plan:

Reviewers:

CC:

src/parser/diff/change/ArcanistDiffChange.php

index 61a133a8f9f03b1c883dd5303dab038298c35761..d45402d7f84b9906f373b89d6db9e1cabd800ff5 100644 (file)
@@ -63,9 +63,11 @@ class ArcanistDiffChange {
     $obj->metdadata = $dict['metadata'];
     $obj->oldPath = $dict['oldPath'];
     $obj->currentPath = $dict['currentPath'];
-    $obj->awayPaths = $dict['awayPaths'];
-    $obj->oldProperties = $dict['oldProperties'];
-    $obj->newProperties = $dict['newProperties'];
+    // TODO: The backend is shipping down some bogus data, e.g. diff 199453.
+    // Should probably clean this up.
+    $obj->awayPaths     = nonempty($dict['awayPaths'],     array());
+    $obj->oldProperties = nonempty($dict['oldProperties'], array());
+    $obj->newProperties = nonempty($dict['newProperties'], array());
     $obj->type = $dict['type'];
     $obj->fileType = $dict['fileType'];
     $obj->commitHash = $dict['commitHash'];