Skip to content
This repository was archived by the owner on Sep 10, 2022. It is now read-only.

Commit 1d758c8

Browse files
author
Matt Gaunt
committed
Fixing an edge case where the path isn't expected
1 parent d589ab0 commit 1d758c8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

server/models/path-config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,15 @@ function getFileContents(files) {
3838

3939
module.exports = {
4040
getConfig: function(urlPath) {
41+
var object = pathConfigs[urlPath];
42+
43+
// Check if the path is actually valid.
44+
if (!object) {
45+
return null;
46+
}
47+
4148
// This needed to ensure changes made to the objects dont stick / alter
4249
// the original object
43-
return Object.create(pathConfigs[urlPath]);
50+
return Object.create(object);
4451
}
4552
};

0 commit comments

Comments
 (0)