Fix NPE in ChangeControl.isPatchVisible(PatchSet, ReviewDb)

Treat a missing PatchSet (likely due to a corrupt change in the
caller) as not a draft; still do the change visibility check.

Change-Id: I6f7efa3184c3fbf60b57fb910b3c38a91e346337
This commit is contained in:
Dave Borowitz
2014-05-12 13:53:10 -07:00
committed by Edwin Kempin
parent d426839c38
commit 084e9f4aae

View File

@@ -260,7 +260,7 @@ public class ChangeControl {
/** Can this user see the given patchset? */
public boolean isPatchVisible(PatchSet ps, ReviewDb db) throws OrmException {
if (ps.isDraft() && !isDraftVisible(db, null)) {
if (ps != null && ps.isDraft() && !isDraftVisible(db, null)) {
return false;
}
return isVisible(db);