Skip to content

Commit

Permalink
Fixes #600. Provides a fix for crashing home page.
Browse files Browse the repository at this point in the history
The index controller does not properly handle errors and does not properly check for null or undefined indices in the list of articles it is provided.  When it passes a null or undefined value the meta info is gathering is skipped causing a failure when the callback is returned and the error is not handled.
  • Loading branch information
brianhyder committed May 13, 2015
1 parent 9cb4da9 commit 2b5a86a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion include/service/entities/article_service.js
Expand Up @@ -476,7 +476,17 @@ module.exports = function ArticleServiceModule(pb) {
*/
ArticleService.prototype.getMetaInfo = function(article, cb) {
if (util.isNullOrUndefined(article)) {
return cb(new Error('The article parameter cannot be null'));
return cb(
new Error('The article parameter cannot be null'),

//provided for backward compatibility
{
title: '',
description: '',
thumbnail: '',
keywords: []
}
);
}

//compile the tasks necessary to gather the meta info
Expand Down

0 comments on commit 2b5a86a

Please sign in to comment.