Skip to content

Commit 0a42b77

Browse files
Merge pull request #1041 from HeshanSudarshana/main-upstream
Add null check for settings for create API flow
2 parents 2220555 + b494c9f commit 0a42b77

File tree

1 file changed

+3
-3
lines changed
  • portals/publisher/src/main/webapp/source/src/app/components/Apis/Create/Components

1 file changed

+3
-3
lines changed

portals/publisher/src/main/webapp/source/src/app/components/Apis/Create/Components/DefaultAPIForm.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,17 +188,17 @@ export default function DefaultAPIForm(props) {
188188

189189
if (multiGateway) {
190190
// If the gateway type is not in the gatewayTypeMap, add it with both key and value equal to the type
191-
if (settings.gatewayTypes) {
191+
if (settings?.gatewayTypes) {
192192
settings.gatewayTypes.forEach(type => {
193193
if (!(type in gatewayTypeMap)) {
194194
gatewayTypeMap[type] = type;
195195
}
196196
});
197197
}
198198

199-
const settingsEnvList = settings && settings.environment;
199+
const settingsEnvList = settings?.environment;
200200
multiGateway.forEach((gateway) => {
201-
if (settings && settings.gatewayTypes.length >= 2 && Object
201+
if (settings?.gatewayTypes.length >= 2 && Object
202202
.values(gatewayTypeMap).includes(gateway.value)) {
203203
for (const env of settingsEnvList) {
204204
const tmpEnv = gatewayTypeMap[env.gatewayType];

0 commit comments

Comments
 (0)