From e089dd99a3d071a4a08ebeb93beeb8f07ea5282d Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Tue, 2 Apr 2019 16:29:09 -0700 Subject: [PATCH] Avoid crash when no disks are connected * It was attempting to recheck the NVMe/SMART data for the fake N/A lines --- .bin/Scripts/functions/hw_diags.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index a5fc5e5d..f5235111 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -1012,7 +1012,9 @@ def run_hw_tests(state): # Recheck attributes if state.tests['NVMe / SMART']['Enabled']: for test_obj in state.tests['NVMe / SMART']['Objects']: - run_nvme_smart_tests(state, test_obj, update_mode=True) + if test_obj.dev is not None: + # dev == None for the 'N/A' lines set above + run_nvme_smart_tests(state, test_obj, update_mode=True) except GenericAbort: # Cleanup