Fix "Failed to reindex changes"

Since ReindexAfterUpdate starts tasks asynchronously, it is possible for
a change that was once in the list of changes to get reindexed to no
longer exist. This could happen if a draft change existed at the moment
GetChanges was called and got deleted before db.get(id) is called. In
this case, it returns null and ChangeDataFactory tries to create a
ChangeData with a null Change which causes a ProvisionException.

This fix simply checks if the returned value is null and doesn't try to
reindex the change since it doesn't exist anymore.

Change-Id: I15dc1bde132a826a7ce1c7afef9242a7537ab894
1 file changed