Check for presence of API before using

This commit is contained in:
David Taylor 2017-02-27 22:30:37 +00:00
parent d041d6a821
commit 8245c7b5e7
1 changed files with 3 additions and 1 deletions

View File

@ -113,7 +113,9 @@ function initializeWithApi(api) {
api.includePostAttributes('can_accept_answer', 'can_unaccept_answer', 'accepted_answer'); api.includePostAttributes('can_accept_answer', 'can_unaccept_answer', 'accepted_answer');
api.addDiscoveryQueryParam('solved', {replace: true, refreshModel: true}); if (api.addDiscoveryQueryParam) {
api.addDiscoveryQueryParam('solved', {replace: true, refreshModel: true});
}
api.addPostMenuButton('solved', attrs => { api.addPostMenuButton('solved', attrs => {
const canAccept = attrs.can_accept_answer; const canAccept = attrs.can_accept_answer;