mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 03:15:42 +03:00
plugins/drivers: fix panic when copying a nil TaskHandle
This commit is contained in:
@@ -29,6 +29,10 @@ func (h *TaskHandle) GetDriverState(v interface{}) error {
|
||||
}
|
||||
|
||||
func (h *TaskHandle) Copy() *TaskHandle {
|
||||
if h == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
handle := new(TaskHandle)
|
||||
*handle = *h
|
||||
handle.Config = h.Config.Copy()
|
||||
|
||||
Reference in New Issue
Block a user