HomePhabricator

Fix NPE in ChangeDetailFactory for loadMessages isPatchVisible

Authored by Shawn Pearce <sop@google.com> on Oct 8 2013, 12:19 AM.

Description

Fix NPE in ChangeDetailFactory for loadMessages isPatchVisible

If the patch set wasn't loaded from the database don't load its
associated messages. This can happen as a race condition where:

reader (T1):

scans patch sets

writer (T2):

 inserts new patch set
 inserts new message

reader (T1):
  scans messages

The reader doesn't know about the new patch set and cannot
validate if it is a draft or not. Since the reader is under
the assumption the patch set does not exist simply skipping
newer messages is sane.

Change-Id: Ifd2000364bcf6ce8f37935bd8c4cc1725fb52a64

Details

Event Timeline

Shawn Pearce <sop@google.com> committed rGERRITDEPLOY0e03b79ba4a7: Fix NPE in ChangeDetailFactory for loadMessages isPatchVisible (authored by Shawn Pearce <sop@google.com>).Oct 8 2013, 12:19 AM