From 31735661937ece6406518ec4b80217509f59bb76 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Thu, 24 Oct 2024 19:43:03 -0400 Subject: WARP: Handle no default architecture gracefully when loading types --- plugins/warp/src/plugin/types.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins/warp/src/plugin') 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)); } -- cgit v1.3.1