diff --git a/lib/session.js b/lib/session.js index e54a157..3545217 100644 --- a/lib/session.js +++ b/lib/session.js @@ -891,7 +891,7 @@ function runDeclarations(sessionContext, declarations) { let keys; if (Array.isArray(path[path.length - 1])) { keys = {}; - for (let i = 0; i < path[path.length - 1]; i += 2) { + for (let i = 0; i < path[path.length - 1].length; i += 2) { keys[path[path.length - 1][i].join(".")] = path[path.length - 1][i + 1]; } @@ -1668,7 +1668,7 @@ function generateSetRpcRequest(sessionContext) { // Downloads for (const [p, t] of syncState.downloadsDownload) { - const attrs = deviceData.attrs.get(p); + const attrs = deviceData.attributes.get(p); if (!(attrs && attrs.value && t <= attrs.value[1][0])) { const fileTypeAttrs = deviceData.attributes.get( deviceData.paths.get(p.slice(0, -1).concat("FileType"))