Skip to content

Commit

Permalink
Handle unpopulated form when checking if we can create posts
Browse files Browse the repository at this point in the history
Post survey service needs to cope with an undefined form.
  • Loading branch information
rjmackay committed Sep 2, 2016
1 parent b5ffd2f commit 7741e92
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/post/shared/post-survey.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ function PostSurveyService(
};

function canCreatePostInSurvey(form) {
// If the form isn't loaded yet, we definitely can't add to it
if (!form) {
return false;
}

if ($rootScope.hasPermission('Manage Posts')) {
return true;
}
Expand Down

0 comments on commit 7741e92

Please sign in to comment.