summaryrefslogtreecommitdiff
path: root/plugins/warp/src/plugin
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2024-10-24 19:43:03 -0400
committerMason Reed <mason@vector35.com>2024-10-24 19:43:03 -0400
commit31735661937ece6406518ec4b80217509f59bb76 (patch)
tree65bc39d74c7e2583c9b2fa8a89dfed818c60b335 /plugins/warp/src/plugin
parentf9ff195350d6dc0bf19627cf1f19e36b20890a31 (diff)
WARP: Handle no default architecture gracefully when loading types
Diffstat (limited to 'plugins/warp/src/plugin')
-rw-r--r--plugins/warp/src/plugin/types.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/warp/src/plugin/types.rs b/plugins/warp/src/plugin/types.rs
index b8718a63..ecb60428 100644
--- a/plugins/warp/src/plugin/types.rs
+++ b/plugins/warp/src/plugin/types.rs
@@ -23,6 +23,11 @@ impl Command for LoadTypesCommand {
log::error!("Could not get data from signature file: {:?}", file);
return;
};
+
+ let Some(arch) = view.default_arch() else {
+ log::error!("Could not get default architecture");
+ return;
+ };
let view = view.to_owned();
std::thread::spawn(move || {
@@ -36,8 +41,6 @@ impl Command for LoadTypesCommand {
for comp_ty in data.types {
let ty_id = comp_ty.guid.to_string();
let ty_name = comp_ty.ty.name.to_owned().unwrap_or_else(|| ty_id.clone());
- // TODO: Using arch here is problematic.
- let arch = view.default_arch().unwrap();
view.define_auto_type_with_id(ty_name, ty_id, &to_bn_type(&arch, &comp_ty.ty));
}