Skip to content

Commit 712c5e7

Browse files
tamilmani1989sharmasushant
authored andcommitted
Added a validation check for reading file
1 parent aad93c5 commit 712c5e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

telemetry/telemetry_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (report *Report) GetOSDetails() {
9393
osType := "Linux"
9494

9595
linesArr, err := ReadFileByLines("/etc/issue")
96-
if err != nil {
96+
if err != nil || len(linesArr) <= 0 {
9797
report.OSDetails = &OSInfo{OSType: "Linux"}
9898
report.OSDetails.ErrorMessage = "reading /etc/issue failed with" + err.Error()
9999
return

0 commit comments

Comments
 (0)