mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-01 04:13:41 +01:00
chore: added graceful check while accessing path params
This commit is contained in:
parent
b2038c7cc2
commit
1239baf687
@ -82,7 +82,7 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces
|
|||||||
request.data = _interpolate(request.data);
|
request.data = _interpolate(request.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
each(request.pathParams, (param) => {
|
each(request?.pathParams, (param) => {
|
||||||
param.value = _interpolate(param.value);
|
param.value = _interpolate(param.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces
|
|||||||
return '/' + path;
|
return '/' + path;
|
||||||
} else {
|
} else {
|
||||||
const name = path.slice(1);
|
const name = path.slice(1);
|
||||||
const existingPathParam = request.pathParams.find((param) => param.type === 'path' && param.name === name);
|
const existingPathParam = request?.pathParams?.find((param) => param.type === 'path' && param.name === name);
|
||||||
return existingPathParam ? '/' + existingPathParam.value : '';
|
return existingPathParam ? '/' + existingPathParam.value : '';
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user