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.
Signed-off-by: Edwin Kempin <firstname.lastname@example.org>
1 file changed