3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Extra fix

This commit is contained in:
Dragory 2020-09-23 20:23:19 +03:00
parent bfb7379279
commit 9dbf80ce58
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
2 changed files with 6 additions and 0 deletions

View file

@ -347,6 +347,7 @@ export function get(obj, path, def?): any {
let cursor = obj;
const pathParts = path.split(".");
for (const part of pathParts) {
// hasOwnProperty check here is necessary to prevent prototype traversal in tags
if (!cursor.hasOwnProperty(part)) return def;
cursor = cursor[part];
if (cursor === undefined) return def;