PatchListCacheImpl: explicitly check for null revision

Change-Id: Ib88d104ebd288e16ee2499ca93cecd4a8b9e2b2a
(cherry picked from commit 8909bc4c2c)
This commit is contained in:
Dave Borowitz
2013-10-29 11:19:35 -07:00
committed by David Pursehouse
parent c9b686056e
commit b1d685db43

View File

@@ -90,6 +90,10 @@ public class PatchListCacheImpl implements PatchListCache {
throws PatchListNotAvailableException {
final Project.NameKey projectKey = change.getProject();
final ObjectId a = null;
if (patchSet.getRevision() == null) {
throw new PatchListNotAvailableException(
"revision is null for " + patchSet.getId());
}
final ObjectId b = ObjectId.fromString(patchSet.getRevision().get());
final Whitespace ws = Whitespace.IGNORE_NONE;
return get(new PatchListKey(projectKey, a, b, ws));