Ver código fonte

Makes CheckValid check nil Location in Samples.

Hyoun Kyu Cho 8 anos atrás
pai
commit
f64de01b18
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5
    0
      profile/profile.go

+ 5
- 0
profile/profile.go Ver arquivo

@@ -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