make NAME field non-optional for Gear, Tome, Charm

This commit is contained in:
endernon 2025-01-02 12:06:52 +00:00
parent 84e696bea2
commit 6313b56064
2 changed files with 7 additions and 0 deletions

View file

@ -42,4 +42,8 @@ pub enum Errorfr {
/// unable to copy (write in) file content
#[error("Error 3.4: Download successful, but unable to write to file.")]
JsonDlReqFileWriteFail,
/// Name value was not found in json
#[error("Error 3.4: \"Name\" field was not found in the json (required for Gear, Tome, Charm)")]
JsonNotFoundName
}

View file

@ -135,6 +135,9 @@ fn cook(
if let Some(real_name) = json_config.name {
encode_namedata(&mut fr_params, &real_name)
}
else {
return Err(Errorfr::JsonNotFoundName)
}
}
_ => {}
}