Skip to content

Commit 2ef8f98

Browse files
authored
Allow for empty string context path. (#328)
1 parent a0b1829 commit 2ef8f98

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Tomcat/TomcatController.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,14 @@ export class TomcatController {
371371
const xml: string = fs.readFileSync(path.join(folderLocation, 'META-INF', 'context.xml'), 'utf8');
372372
const jsonFromXml: any = await Utility.parseXml(xml);
373373
if (jsonFromXml) {
374-
if (jsonFromXml.Context && jsonFromXml.Context.$ && jsonFromXml.Context.$.path) {
375-
appName = this.parseContextPathToFolderName(jsonFromXml.Context.$.path);
376-
} else if (jsonFromXml.context && jsonFromXml.context.$ && jsonFromXml.context.$.path) {
377-
appName = this.parseContextPathToFolderName(jsonFromXml.context.$.path);
374+
if (jsonFromXml.Context && jsonFromXml.Context.$) {
375+
if (jsonFromXml.Context.$.path != null) {
376+
appName = this.parseContextPathToFolderName(jsonFromXml.Context.$.path);
377+
}
378+
} else if (jsonFromXml.context && jsonFromXml.context.$) {
379+
if (jsonFromXml.context.$.path != null) {
380+
appName = this.parseContextPathToFolderName(jsonFromXml.context.$.path);
381+
}
378382
}
379383
}
380384
}

0 commit comments

Comments
 (0)