Skip to content

Commit

Permalink
store 초기화 방어 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bipark committed Oct 24, 2018
1 parent 37fc1cf commit 2d747f6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ const store = () => new Vuex.Store({
actions: {
nuxtServerInit ({ commit }, { req }) {

const user = this.$cookies.get("authuser");
if (user) {
commit("setUser", user);
} else {
commit("setUser", null);
if (this.$cookies) {
const user = this.$cookies.get("authuser");
if (user) {
commit("setUser", user);
} else {
commit("setUser", null);
}
}

if (process.env.B_COLOR && process.env.BG_COLOR) {
Expand Down

0 comments on commit 2d747f6

Please sign in to comment.