Browse Source

Refs #5129: Change return to throw error on callback missing

Chris Sexton 11 years ago
parent
commit
af065afa73
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lib/pipeline/documentSources/SortDocumentSource.js

+ 2 - 2
lib/pipeline/documentSources/SortDocumentSource.js

@@ -80,6 +80,8 @@ proto.coalesce = function coalesce(nextSource) {
 };
 
 proto.getNext = function getNext(callback) {
+	if (!callback) throw new Error(this.getSourceName() + ' #getNext() requires callback');
+
 	var self = this;
 	async.series([
 			function(next) {
@@ -264,5 +266,3 @@ klass.createFromJson = function createFromJson(jsonElement, ctx) {
 	if (sortKeys <= 0) throw new Error("code 15976; " + klass.sortName + " must have at least one sort key");
 	return nextSort;
 };
-
-// makeSortOptions