Skip to content

Commit

Permalink
fix possible null dereferencing, reported by #96
Browse files Browse the repository at this point in the history
  • Loading branch information
z4yx committed Aug 13, 2019
1 parent 540eea8 commit 94cf0b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions worker/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ func newMirrorProvider(mirror mirrorConfig, cfg *Config) mirrorProvider {
env: mirror.Env,
}
p, err := newCmdProvider(pc)
p.isMaster = isMaster
if err != nil {
panic(err)
}
p.isMaster = isMaster
provider = p
case provRsync:
rc := rsyncConfig{
Expand All @@ -141,10 +141,10 @@ func newMirrorProvider(mirror mirrorConfig, cfg *Config) mirrorProvider {
retry: mirror.Retry,
}
p, err := newRsyncProvider(rc)
p.isMaster = isMaster
if err != nil {
panic(err)
}
p.isMaster = isMaster
provider = p
case provTwoStageRsync:
rc := twoStageRsyncConfig{
Expand All @@ -163,10 +163,10 @@ func newMirrorProvider(mirror mirrorConfig, cfg *Config) mirrorProvider {
retry: mirror.Retry,
}
p, err := newTwoStageRsyncProvider(rc)
p.isMaster = isMaster
if err != nil {
panic(err)
}
p.isMaster = isMaster
provider = p
default:
panic(errors.New("Invalid mirror provider"))
Expand Down

0 comments on commit 94cf0b4

Please sign in to comment.