Skip to content

Commit 640ba3e

Browse files
authored
fix(plugin): check if __NUXT__.apollo exists
1 parent f262459 commit 640ba3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/templates/plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default (ctx, inject) => {
5454
: new InMemoryCache(<%= key %>ClientConfig.inMemoryCacheOptions ? <%= key %>ClientConfig.inMemoryCacheOptions: undefined)
5555

5656
if (!process.server) {
57-
<%= key %>Cache.restore(window.__NUXT__ ? window.__NUXT__.apollo.<%= key === 'default' ? 'defaultClient' : key %> : null)
57+
<%= key %>Cache.restore(window.__NUXT__ && window.__NUXT__.apollo ? window.__NUXT__.apollo.<%= key === 'default' ? 'defaultClient' : key %> : null)
5858
}
5959

6060
if (!<%= key %>ClientConfig.getAuth) {

0 commit comments

Comments
 (0)