We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4cd231 commit c030ba6Copy full SHA for c030ba6
tss-esapi/src/context/handle_manager.rs
@@ -40,9 +40,8 @@ impl HandleManager {
40
return Err(Error::local_error(WrapperErrorKind::InvalidParam));
41
}
42
43
- if self.open_handles.contains_key(&handle) {
44
- // It is safe to call unwrap because the existance of the key has already been verified.
45
- let stored_handle_drop_action = self.open_handles.get(&handle).unwrap();
+ // The TSS might return the same handle, see #383
+ if let Some(stored_handle_drop_action) = self.open_handles.get(&handle) {
46
if handle_drop_action != *stored_handle_drop_action {
47
error!("Handle drop action inconsistency");
48
return Err(Error::local_error(WrapperErrorKind::InconsistentParams));
0 commit comments