mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-24 17:03:47 +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);
|
||||
}
|
||||
|
||||
each(request.pathParams, (param) => {
|
||||
each(request?.pathParams, (param) => {
|
||||
param.value = _interpolate(param.value);
|
||||
});
|
||||
|
||||
@ -107,7 +107,7 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces
|
||||
return '/' + path;
|
||||
} else {
|
||||
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 : '';
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user