Skip to content

Commit

Permalink
#394 Load default value even if snapshot doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Jul 4, 2022
1 parent c4f4f4b commit ac76181
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion main/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "realearn"
version = "2.13.0-pre.11"
version = "2.13.0-pre.12"
authors = ["Benjamin Klum <[email protected]>"]
edition = "2021"
build = "build.rs"
Expand Down
7 changes: 2 additions & 5 deletions main/src/domain/targets/load_mapping_snapshot_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,9 @@ impl HitInstruction for LoadMappingSnapshotInstruction {
VirtualMappingSnapshot::ById(id) => {
let instance_state = context.control_context.instance_state.borrow();
let snapshot_container = instance_state.mapping_snapshot_container();
let snapshot = match snapshot_container.find_snapshot_by_id(id) {
None => return vec![],
Some(s) => s,
};
let snapshot = snapshot_container.find_snapshot_by_id(id);
self.load_snapshot(context, |m| {
snapshot.find_target_value_by_mapping_id(m.id())
snapshot.and_then(|s| s.find_target_value_by_mapping_id(m.id()))
})
}
}
Expand Down

0 comments on commit ac76181

Please sign in to comment.