Do not fail with NPE if change is not found

If a change ref is updated the plugin expects to find the
corresponding change in the database and fails with a
NullPointerException if the change cannot be found in the database.

Add a check for this case and do not fail with an NPE, but instead
ignore this ref update and write a warning into the log.

Unfortunately in a few cases Gerrit sends the ref-updated event for the
change ref before it creates the change in the database. This happens
whenever the project.config in refs/meta/config is updated, e.g. if
permissions of a project are changed and saved for review.

Change-Id: I10ca7603dc57a1aa9bc29ec396f2c9f988e9fc3d
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
1 file changed
tree: f73234bc68c06b701aaafc8721b1a6aac2a171fb
  1. .settings/
  2. src/
  3. .gitignore
  4. LICENSE
  5. pom.xml