mirror of https://github.com/daffainfo/nuclei.git
Additional nil check on interactsh client (#3590)
parent
97e7081c69
commit
ea5f8a0638
|
@ -1,6 +1,7 @@
|
|||
package interactsh
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"regexp"
|
||||
"time"
|
||||
)
|
||||
|
@ -8,6 +9,8 @@ import (
|
|||
var (
|
||||
defaultInteractionDuration = 60 * time.Second
|
||||
interactshURLMarkerRegex = regexp.MustCompile(`{{interactsh-url(?:_[0-9]+){0,3}}}`)
|
||||
|
||||
ErrInteractshClientNotInitialized = errors.New("interactsh client not initialized")
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -202,9 +202,14 @@ func (c *Client) URL() (string, error) {
|
|||
err = c.poll()
|
||||
})
|
||||
if err != nil {
|
||||
return "", errorutil.NewWithErr(err).Msgf("interactsh client not initialized")
|
||||
return "", errorutil.NewWithErr(err).Wrap(ErrInteractshClientNotInitialized)
|
||||
}
|
||||
// ensures interactsh is not nil
|
||||
if c.interactsh == nil {
|
||||
return "", ErrInteractshClientNotInitialized
|
||||
}
|
||||
}
|
||||
|
||||
c.generated.Store(true)
|
||||
return c.interactsh.URL(), nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue