Skip to content

Commit e50bde5

Browse files
committed
check pointer
1 parent a2be270 commit e50bde5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/namespaces/instance/v1/custom_server_create.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ func instanceServerCreateRun(ctx context.Context, argsI interface{}) (i interfac
291291
return nil, err
292292
}
293293

294-
volumes = addDefaultVolumes(apiInstance, args.Zone, serverType, volumes)
294+
if serverType != nil {
295+
volumes = addDefaultVolumes(serverType, volumes)
296+
}
295297

296298
// Validate root volume type and size.
297299
if getImageResponse != nil {
@@ -435,7 +437,7 @@ func instanceServerCreateRun(ctx context.Context, argsI interface{}) (i interfac
435437
return server, nil
436438
}
437439

438-
func addDefaultVolumes(api *instance.API, zone scw.Zone, serverType *instance.ServerType, volumes map[string]*instance.VolumeServerTemplate) map[string]*instance.VolumeServerTemplate {
440+
func addDefaultVolumes(serverType *instance.ServerType, volumes map[string]*instance.VolumeServerTemplate) map[string]*instance.VolumeServerTemplate {
439441
needScratch := false
440442
hasScratch := false
441443
if serverType.ScratchStorageMaxSize != nil && *serverType.ScratchStorageMaxSize > 0 {

0 commit comments

Comments
 (0)