From 9dfb846041a536d565293aba72fe83da4cb06bd5 Mon Sep 17 00:00:00 2001 From: CorpNewt Date: Thu, 18 Oct 2018 12:42:27 -0500 Subject: [PATCH] Fixes for some potential int casting issues --- Scripts/diskwin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Scripts/diskwin.py b/Scripts/diskwin.py index 3cbd93f..9184aab 100644 --- a/Scripts/diskwin.py +++ b/Scripts/diskwin.py @@ -106,10 +106,11 @@ class Disk: pr = p_dict["partitions"][pr] if pr.get("letter","").upper() == plt.upper(): # Found it - set all attributes - pr["size"] = int(psz) + pr["size"] = int(psz) if len(psz) else -1 pr["file system"] = pfs pr["name"] = pnm # Also need to set the parent drive's type - p_dict["type"] = int(ptp) + if len(ptp): + p_dict["type"] = int(ptp) break return p_disks