瀏覽代碼

Makes CheckValid check nil Location in Samples.

Hyoun Kyu Cho 8 年之前
父節點
當前提交
f64de01b18
共有 1 個檔案被更改,包括 5 行新增0 行删除
  1. 5
    0
      profile/profile.go

+ 5
- 0
profile/profile.go 查看文件

322
 		if len(s.Value) != sampleLen {
322
 		if len(s.Value) != sampleLen {
323
 			return fmt.Errorf("mismatch: sample has: %d values vs. %d types", len(s.Value), len(p.SampleType))
323
 			return fmt.Errorf("mismatch: sample has: %d values vs. %d types", len(s.Value), len(p.SampleType))
324
 		}
324
 		}
325
+		for _, l := range s.Location {
326
+			if l == nil {
327
+				return fmt.Errorf("sample has nil location")
328
+			}
329
+		}
325
 	}
330
 	}
326
 
331
 
327
 	// Check that all mappings/locations/functions are in the tables
332
 	// Check that all mappings/locations/functions are in the tables