Skip to content
This repository has been archived by the owner on Dec 3, 2022. It is now read-only.

Commit

Permalink
check for field existence before setting
Browse files Browse the repository at this point in the history
Signed-off-by: dmig <[email protected]>
  • Loading branch information
dmig committed Apr 4, 2019
1 parent ec0774a commit 02bdd11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/store/tguser/mutations.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export function fill (state, user) {
reset(state)
if (!user) return
for (let k in state) state[k] = user[k]
for (let k in state) if (k in user) state[k] = user[k]
}

export function reset (state) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/store/vkuser/mutations.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export function fill (state, user) {
reset(state)
if (!user) return
for (let k in state) state[k] = user[k]
for (let k in state) if (k in user) state[k] = user[k]
}

export function reset (state) {
Expand Down

0 comments on commit 02bdd11

Please sign in to comment.