Fix: NPE when editing topic name of change uploaded without topic
If a change is uploaded for review without specifying a topic name, the topic field in the change record is null. This causes a Null Pointer Exception when attempting to compare the old topic name with the new one. Add a check to initialise the topic name to empty string if it is null. Change-Id: Iae95bf78f87c1af181db327770f74a514258ced5
This commit is contained in:
@@ -93,7 +93,7 @@ public class AlterTopic implements Callable<ReviewResult> {
|
||||
}
|
||||
|
||||
final Change change = db.changes().get(changeId);
|
||||
final String oldTopicName = change.getTopic();
|
||||
final String oldTopicName = change.getTopic() != null ? change.getTopic() : "";
|
||||
if (!oldTopicName.equals(newTopicName)) {
|
||||
String summary;
|
||||
if (oldTopicName.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user