Prechádzať zdrojové kódy

protect against the body not existing for new users

Adam Rensel 8 rokov pred
rodič
commit
9a6aa05b89

+ 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