Skip to content
Browse files

fixed error handling and method signature

  • Loading branch information...
1 parent 614886c commit cdecd0234f4b6db9761afdfdc9e39db1703f8355 @jwulf committed
Showing with 10 additions and 6 deletions.
  1. +1 −1 package.json
  2. +9 −5 pressgangccms.js
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "pressgang-rest",
- "version": "0.0.3",
+ "version": "0.0.4",
"description": "A high level library for REST communication with a PressGang Component Content Management System (CCMS) Server",
"main": "index.js",
"scripts": {
View
14 pressgangccms.js
@@ -60,11 +60,14 @@ PressGangCCMS.prototype.set = function (key, value) {
PressGangCCMS.prototype.isContentSpec = function(topic_id, cb)
{
- this.getTopicData(topic_id, 'topic-tags', function(err, result){
- var is_spec = false;
- if (result && result.length > 0){
- for (var i = 0; i < result.length; i ++){
- if (result[i].item.id == constants.contentSpecTagID) is_spec = true;
+ this.getTopicData('topic-tags', topic_id, function(err, result){
+ if (!err)
+ {
+ var is_spec = false;
+ if (result && result.length > 0){
+ for (var i = 0; i < result.length; i ++){
+ if (result[i].item.id == constants.contentSpecTagID) is_spec = true;
+ }
}
}
cb(err, is_spec);
@@ -131,3 +134,4 @@ PressGangCCMS.prototype.getTopicData = function(data_request, topic_id, cb)
}
}
+

0 comments on commit cdecd02

Please sign in to comment.
Something went wrong with that request. Please try again.