Skip to content

Commit

Permalink
Clone value instead of using reference
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonli0616 committed Mar 19, 2024
1 parent 834ea7f commit 77e4ace
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class CommandGroupWidget extends StatelessWidget {
undoStack.add(Change(
CommandGroup.cloneCommandsList(command.commands),
() {
Command commandToDuplicate = command.commands.elementAt(idx);
Command commandToDuplicate = command.commands.elementAt(idx).clone();
command.commands.insert(idx+1, commandToDuplicate);
onUpdated?.call();

Check warning on line 305 in lib/widgets/editor/tree_widgets/commands/command_group_widget.dart

View check run for this annotation

Codecov / codecov/patch

lib/widgets/editor/tree_widgets/commands/command_group_widget.dart#L299-L305

Added lines #L299 - L305 were not covered by tests
},
Expand Down

0 comments on commit 77e4ace

Please sign in to comment.