Преглед на файлове

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