Skip to content

Commit a35f67b

Browse files
committed
Avoid running mineVersion when the SMARTctlInfo struct is not ready
Signed-off-by: Jakub Klinkovský <[email protected]>
1 parent 6e2143c commit a35f67b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: smartctlinfo.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ func (smart *SMARTctlInfo) SetJSON(json gjson.Result) {
4545

4646
// Collect metrics
4747
func (smart *SMARTctlInfo) Collect() {
48-
smart.mineVersion()
48+
if smart.Ready {
49+
smart.mineVersion()
50+
}
4951
}
5052

5153
func (smart *SMARTctlInfo) mineVersion() {

0 commit comments

Comments
 (0)