Browse Source

protect against the body not existing for new users

Adam Rensel 8 years ago
parent
commit
9a6aa05b89
3 changed files with 5 additions and 2 deletions
  1. 3 1
      app/js/directives/nw-card.js
  2. 2 1
      app/server/modules/dataSeeds.js
  3. BIN
      database.sqlite

+ 3 - 1
app/js/directives/nw-card.js

@@ -13,7 +13,9 @@ angular.module('NoteWrangler')
     },
     templateUrl: "templates/directives/nw-card.html",
     link: function(scope, element) {
-      scope.body = $sce.trustAsHtml(markdown.toHTML(scope.body.toString()));
+      if(scope.body){
+        scope.body = $sce.trustAsHtml(markdown.toHTML(scope.body.toString()));
+      }
     }
   };
 }]);

+ 2 - 1
app/server/modules/dataSeeds.js

@@ -65,7 +65,8 @@ module.exports = {
 
     User.findOrCreate({
       "username": "renz",
-      "name": "Adam Rensel","bio": "Web Developer at @envylabs and @codeschool",
+      "name": "Adam Rensel",
+      "bio": "Web Developer at @envylabs and @codeschool",
       "twitter_handle": "@adamrensel",
       "site": "adamrensel.com"}).success(function(user){
 

BIN
database.sqlite