Fixed panic in http executer

This commit is contained in:
Ice3man543 2020-12-29 19:35:16 +05:30
parent 8bc9587881
commit 1bb4a2568a

View File

@ -109,9 +109,12 @@ func (r *Request) Compile(options *protocols.ExecuterOptions) error {
// Requests returns the total number of requests the YAML rule will perform // Requests returns the total number of requests the YAML rule will perform
func (r *Request) Requests() int { func (r *Request) Requests() int {
if len(r.Payloads) > 0 { if r.generator != nil {
payloadRequests := r.generator.NewIterator().Total() payloadRequests := r.generator.NewIterator().Total()
return len(r.Raw) * payloadRequests return len(r.Raw) * payloadRequests
} }
if len(r.Raw) > 0 {
return len(r.Raw)
}
return len(r.Path) return len(r.Path)
} }