From 2043f54c0077a0b45f005bc7f832617a78dc63cf Mon Sep 17 00:00:00 2001 From: Jussi Kuokkanen Date: Wed, 4 Oct 2023 15:54:04 +0300 Subject: [PATCH] don't show core voltage offset when not available --- src/plugins/Nvidia.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plugins/Nvidia.cpp b/src/plugins/Nvidia.cpp index 568afa2..29f2012 100644 --- a/src/plugins/Nvidia.cpp +++ b/src/plugins/Nvidia.cpp @@ -607,11 +607,13 @@ std::vector> getVoltageOffset(NvidiaGPUData data) { Assignable a{setFunc, range, getFunc, "mV"}; - return {DeviceNode{ - .name = "Core Voltage Offset", - .interface = a, - .hash = md5(data.uuid + "Core Voltage Offset"), - }}; + if (getFunc().has_value()) + return {DeviceNode{ + .name = "Core Voltage Offset", + .interface = a, + .hash = md5(data.uuid + "Core Voltage Offset"), + }}; + return {}; } std::vector> getMultiFanRoots(NvidiaGPUData data) {