diff --git a/projects/rocm-smi-lib/include/rocm_smi/rocm_smi_common.h b/projects/rocm-smi-lib/include/rocm_smi/rocm_smi_common.h index fd99fb2f6c..9ed0052a87 100755 --- a/projects/rocm-smi-lib/include/rocm_smi/rocm_smi_common.h +++ b/projects/rocm-smi-lib/include/rocm_smi/rocm_smi_common.h @@ -51,7 +51,7 @@ #include #define DBG_FILE_ERROR(FN, WR_STR) \ - if (env_->debug_output_bitfield & RSMI_DEBUG_SYSFS_FILE_PATHS) { \ + if (env_ && env_->debug_output_bitfield & RSMI_DEBUG_SYSFS_FILE_PATHS) { \ std::cout << "*****" << __FUNCTION__ << std::endl; \ std::cout << "*****Opening file: " << (FN) << std::endl; \ if ((WR_STR) != nullptr) { \