Bladeren bron

Makes CheckValid check nil Location in Samples.

Hyoun Kyu Cho 8 jaren geleden
bovenliggende
commit
f64de01b18
1 gewijzigde bestanden met toevoegingen van 5 en 0 verwijderingen
  1. 5
    0
      profile/profile.go

+ 5
- 0
profile/profile.go Bestand weergeven

@@ -322,6 +322,11 @@ func (p *Profile) CheckValid() error {
322 322
 		if len(s.Value) != sampleLen {
323 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 332
 	// Check that all mappings/locations/functions are in the tables