Warn if the NRO has no icon instead of crashing

This commit is contained in:
rlaphoenix
2022-11-13 06:12:20 +00:00
parent 7508f9ed14
commit 873e0e8faa
+5
View File
@@ -264,11 +264,16 @@ def build(
else:
icon_file_res = nstool.get_icon(path, icon_file)
if icon_file_res:
if icon_file_res == "No Icon was extracted from the asset.":
log.warning("The NRO does not have an Icon, proceeding without one.")
else:
log.critical(f"Failed extracting the Icon partition from the NRO, {icon_file_res}")
sys.exit(2)
else:
log.debug("Got the Icon partition")
log.debug(base64.b64encode(icon_file.read_bytes()).decode())
if icon_file.exists():
# We must strip every unnecessary metadata or the icon will be a '?'
try:
subprocess.check_output([