mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-21 23:43:15 +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 eventArray = [];
|
||||
if (item.request.tests.length) {
|
||||
if (item?.request?.tests?.length) {
|
||||
eventArray.push({
|
||||
listen: 'test',
|
||||
script: {
|
||||
@ -58,7 +58,7 @@ export const exportCollection = (collection) => {
|
||||
}
|
||||
});
|
||||
}
|
||||
if (item.request.script.req) {
|
||||
if (item?.request?.script?.req) {
|
||||
eventArray.push({
|
||||
listen: 'prerequest',
|
||||
script: {
|
||||
|
Loading…
Reference in New Issue
Block a user