Fix potential NPE in queries with --dependencies (descendants)
If an entry in patch_set_ancestors references a non-existing entry in the change table, an NPE would be thrown and the query would be aborted. Instead, skip over that entry so the query still works. Change-Id: I985c0d0aec926e991eb3b140186c7de0f598b7ea
This commit is contained in:
		| @@ -261,6 +261,12 @@ public class EventFactory { | |||||||
|             continue; |             continue; | ||||||
|           } |           } | ||||||
|           final Change c = db.changes().get(p.getId().getParentKey()); |           final Change c = db.changes().get(p.getId().getParentKey()); | ||||||
|  |           if (c == null) { | ||||||
|  |             log.error("Error while generating the list of descendants for" | ||||||
|  |                 + " revision " + revId.get() + ": Cannot find Change entry in" | ||||||
|  |                 + " database for " + p.getId().getParentKey()); | ||||||
|  |             continue; | ||||||
|  |           } | ||||||
|           ca.neededBy.add(newNeededBy(c, p)); |           ca.neededBy.add(newNeededBy(c, p)); | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Martin Fick
					Martin Fick