Skip to content

Commit

Permalink
Fix #83 Check layout for null before use.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshineo committed Sep 18, 2015
1 parent 7d58a6a commit 6658210
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion angular-deckgrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ angular.module('akoenig.deckgrid').factory('Deckgrid', [
// Okay, the layout has changed.
// Creating a new column structure is not avoidable.
//
if (layout.columns !== this.$$scope.layout.columns) {
if (layout && layout.columns !== this.$$scope.layout.columns) {
self.$$scope.layout = layout;

self.$$scope.$apply(function onApply () {
Expand Down
2 changes: 1 addition & 1 deletion angular-deckgrid.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
"devDependencies": {
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-jshint": "~0.7.1",
"grunt": "~0.4.1"
, "grunt-contrib-concat": "~0.3.0",
"grunt": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-karma": "~0.7.1",
"karma": "~0.12.0",
"karma-jasmine": "~0.1.5",
"karma-chrome-launcher": "~0.1.2"
},
Expand Down
2 changes: 1 addition & 1 deletion src/deckgrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ angular.module('akoenig.deckgrid').factory('Deckgrid', [
// Okay, the layout has changed.
// Creating a new column structure is not avoidable.
//
if (layout.columns !== this.$$scope.layout.columns) {
if (layout && layout.columns !== this.$$scope.layout.columns) {
self.$$scope.layout = layout;

self.$$scope.$apply(function onApply () {
Expand Down

0 comments on commit 6658210

Please sign in to comment.