Avoid running mineVersion when the SMARTctlInfo struct is not ready

Signed-off-by: Jakub Klinkovský <j.l.k@gmx.com>
This commit is contained in:
Jakub Klinkovský 2022-11-04 19:58:12 +01:00
parent 6e2143ca62
commit a35f67bb0f
1 changed files with 3 additions and 1 deletions

View File

@ -45,7 +45,9 @@ func (smart *SMARTctlInfo) SetJSON(json gjson.Result) {
// Collect metrics // Collect metrics
func (smart *SMARTctlInfo) Collect() { func (smart *SMARTctlInfo) Collect() {
smart.mineVersion() if smart.Ready {
smart.mineVersion()
}
} }
func (smart *SMARTctlInfo) mineVersion() { func (smart *SMARTctlInfo) mineVersion() {