BatchUpdate.ChangeContext: Add defensive calls to checkNotNull

Change-Id: I653319a5738f99af46f20657462ed0fe04759735
This commit is contained in:
David Pursehouse
2016-02-12 18:57:57 +09:00
parent 7f3a843cb7
commit d0007a9c4e

View File

@@ -188,6 +188,7 @@ public class BatchUpdate implements AutoCloseable {
@Override @Override
public ReviewDb getDb() { public ReviewDb getDb() {
checkNotNull(dbWrapper);
return dbWrapper; return dbWrapper;
} }
@@ -202,15 +203,20 @@ public class BatchUpdate implements AutoCloseable {
} }
public ChangeNotes getNotes() { public ChangeNotes getNotes() {
return ctl.getNotes(); ChangeNotes n = ctl.getNotes();
checkNotNull(n);
return n;
} }
public ChangeControl getControl() { public ChangeControl getControl() {
checkNotNull(ctl);
return ctl; return ctl;
} }
public Change getChange() { public Change getChange() {
return ctl.getChange(); Change c = ctl.getChange();
checkNotNull(c);
return c;
} }
public void saveChange() { public void saveChange() {