mirror of
https://github.com/usebruno/bruno.git
synced 2025-02-16 17:51:48 +01:00
conditionally accesses properties (#2047)
This commit is contained in:
parent
0173d8812d
commit
615ed0c584
@ -49,7 +49,7 @@ export const exportCollection = (collection) => {
|
|||||||
|
|
||||||
const generateEventSection = (item) => {
|
const generateEventSection = (item) => {
|
||||||
const eventArray = [];
|
const eventArray = [];
|
||||||
if (item.request.tests.length) {
|
if (item?.request?.tests?.length) {
|
||||||
eventArray.push({
|
eventArray.push({
|
||||||
listen: 'test',
|
listen: 'test',
|
||||||
script: {
|
script: {
|
||||||
@ -58,7 +58,7 @@ export const exportCollection = (collection) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (item.request.script.req) {
|
if (item?.request?.script?.req) {
|
||||||
eventArray.push({
|
eventArray.push({
|
||||||
listen: 'prerequest',
|
listen: 'prerequest',
|
||||||
script: {
|
script: {
|
||||||
|
Loading…
Reference in New Issue
Block a user