Eliminate potential NPEs with ChangeData.getChange()
Callers were supposed to be calling hasChange() to determine whether getChange() would return null, but none were. Remove this error-prone pair of methods and just use change(), which includes lazy loading. There are a few places where we need to catch an additional OrmException but these are easy enough to fix. Change-Id: I23335e362715f59e2c093ffec88427739ff0cffc
This commit is contained in:
@@ -384,7 +384,7 @@ public class ChangeJson {
|
||||
}
|
||||
|
||||
LabelTypes labelTypes = ctl.getLabelTypes();
|
||||
if (cd.getChange().getStatus().isOpen()) {
|
||||
if (cd.change().getStatus().isOpen()) {
|
||||
return labelsForOpenChange(cd, labelTypes, standard, detailed);
|
||||
} else {
|
||||
return labelsForClosedChange(cd, labelTypes, standard, detailed);
|
||||
|
||||
Reference in New Issue
Block a user