@@ -113,12 +113,12 @@ const getBaseProfileObject = ({
113
113
profile,
114
114
canConfigureUseK8sDriver,
115
115
} : GetBaseProfileObjectParamsType ) : BuildInfraProfileBase => {
116
- const parsedUseK8sDriverValue = profile . buildxDriverType
116
+ const parsedUseK8sDriverValue = profile ? .buildxDriverType
117
117
? profile . buildxDriverType === BuildXDriverType . KUBERNETES
118
118
: true
119
119
const useK8sDriver = canConfigureUseK8sDriver ? parsedUseK8sDriverValue : null
120
120
121
- if ( fromCreateView ) {
121
+ if ( fromCreateView || ! profile ) {
122
122
return {
123
123
name : '' ,
124
124
description : '' ,
@@ -131,7 +131,7 @@ const getBaseProfileObject = ({
131
131
return {
132
132
id : profile . id ,
133
133
name : profile . name ,
134
- description : profile . description ,
134
+ description : profile . description ?. trim ( ) ,
135
135
type : profile . type ,
136
136
appCount : profile . appCount ,
137
137
useK8sDriver,
@@ -273,12 +273,11 @@ export const getTransformedBuildInfraProfileResponse = ({
273
273
configurationUnits,
274
274
fallbackPlatformConfigurationMap,
275
275
profile : {
276
- ...( profile &&
277
- getBaseProfileObject ( {
278
- fromCreateView,
279
- profile,
280
- canConfigureUseK8sDriver,
281
- } ) ) ,
276
+ ...getBaseProfileObject ( {
277
+ fromCreateView,
278
+ profile,
279
+ canConfigureUseK8sDriver,
280
+ } ) ,
282
281
configurations,
283
282
} ,
284
283
}
@@ -334,7 +333,7 @@ export const getBuildInfraProfilePayload = (
334
333
335
334
const payload : BuildInfraProfileInfoDTO = {
336
335
name : profileInput . name ,
337
- description : profileInput . description ,
336
+ description : profileInput . description ?. trim ( ) ,
338
337
type : profileInput . type ,
339
338
configurations,
340
339
...( canConfigureUseK8sDriver && {
0 commit comments