mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
fix nil ptr exception (because GetType() returns a value even when pk is nil)
This commit is contained in:
@@ -728,6 +728,9 @@ func RunInstallFromCmd(ctx context.Context, ecmd *exec.Cmd, tryDetect bool, mshe
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
}
|
||||
if pk == nil {
|
||||
return fmt.Errorf("no response packet received from client")
|
||||
}
|
||||
if pk.GetType() == packet.InitPacketStr && firstInit {
|
||||
firstInit = false
|
||||
initPacket := pk.(*packet.InitPacketType)
|
||||
|
||||
Reference in New Issue
Block a user