Skip to content

Commit eb7a74d

Browse files
authored
Merge pull request #1295 from smartdevicelink/bugfix/issue_1293
Fix an issue in setVoiceCommands()
2 parents 5349b84 + 0c0237b commit eb7a74d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseVoiceCommandManager.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656

5757
abstract class BaseVoiceCommandManager extends BaseSubManager {
5858

59-
List<VoiceCommand> voiceCommands;
60-
List<VoiceCommand> oldVoiceCommands;
59+
List<VoiceCommand> voiceCommands, oldVoiceCommands;
6160

6261
List<AddCommand> inProgressUpdate;
6362

@@ -127,7 +126,10 @@ public void setVoiceCommands(List<VoiceCommand> voiceCommands){
127126
waitingOnHMIUpdate = false;
128127
lastVoiceCommandId = voiceCommandIdMin;
129128
updateIdsOnVoiceCommands(voiceCommands);
130-
oldVoiceCommands = new ArrayList<>(voiceCommands);
129+
this.oldVoiceCommands = new ArrayList<>();
130+
if (this.voiceCommands != null && !this.voiceCommands.isEmpty()) {
131+
this.oldVoiceCommands.addAll(this.voiceCommands);
132+
}
131133
this.voiceCommands = new ArrayList<>(voiceCommands);
132134

133135
update();

0 commit comments

Comments
 (0)