diff --git a/src/js/_enqueues/wp/theme.js b/src/js/_enqueues/wp/theme.js index 2115037671..a7481053b4 100644 --- a/src/js/_enqueues/wp/theme.js +++ b/src/js/_enqueues/wp/theme.js @@ -28,14 +28,16 @@ themes.Model = Backbone.Model.extend({ initialize: function() { var description; - // If the theme is already installed, set an attribute. - if ( _.indexOf( themes.data.installedThemes, this.get( 'slug' ) ) !== -1 ) { - this.set({ installed: true }); - } + if ( this.get( 'slug' ) ) { + // If the theme is already installed, set an attribute. + if ( _.indexOf( themes.data.installedThemes, this.get( 'slug' ) ) !== -1 ) { + this.set({ installed: true }); + } - // If the theme is active, set an attribute. - if ( themes.data.activeTheme === this.get( 'slug' ) ) { - this.set({ active: true }); + // If the theme is active, set an attribute. + if ( themes.data.activeTheme === this.get( 'slug' ) ) { + this.set({ active: true }); + } } // Set the attributes.