@@ -101,7 +101,8 @@ exports.list = function (aReq, aRes, aNext) {
101101 var tasks = [ ] ;
102102
103103 if ( aErr || ! aScript ) {
104- return aNext ( ) ;
104+ aNext ( ) ;
105+ return ;
105106 }
106107
107108 // Session
@@ -203,7 +204,8 @@ exports.view = function (aReq, aRes, aNext) {
203204 var tasks = [ ] ;
204205
205206 if ( aErr || ! aScript ) {
206- return aNext ( ) ;
207+ aNext ( ) ;
208+ return ;
207209 }
208210
209211 // Session
@@ -260,7 +262,8 @@ exports.view = function (aReq, aRes, aNext) {
260262 var scriptOpenIssueCountQuery = null ;
261263
262264 if ( aErr || ! aDiscussion ) {
263- return aNext ( ) ;
265+ aNext ( ) ;
266+ return ;
264267 }
265268
266269 // Discussion
@@ -331,7 +334,8 @@ exports.open = function (aReq, aRes, aNext) {
331334
332335 // ---
333336 if ( aErr || ! aScript ) {
334- return aNext ( ) ;
337+ aNext ( ) ;
338+ return ;
335339 }
336340
337341 //
@@ -364,18 +368,21 @@ exports.open = function (aReq, aRes, aNext) {
364368
365369 if ( topic && content ) {
366370 if ( ! topic . trim ( ) || ! content . trim ( ) ) {
367- return statusCodePage ( aReq , aRes , aNext , {
371+ statusCodePage ( aReq , aRes , aNext , {
368372 statusCode : 403 ,
369373 statusMessage : 'You cannot post an empty issue topic to this ' +
370374 ( type === 'libs' ? 'library' : 'script' )
371375 } ) ;
376+ return ;
372377 }
373378
374379 // Issue Submission
375380 discussionLib . postTopic ( authedUser , category . slug , topic , content , true ,
376381 function ( aDiscussion ) {
377- if ( ! aDiscussion )
378- return aRes . redirect ( '/' + encodeURI ( category ) + '/open' ) ;
382+ if ( ! aDiscussion ) {
383+ aRes . redirect ( '/' + encodeURI ( category ) + '/open' ) ;
384+ return ;
385+ }
379386
380387 aRes . redirect ( encodeURI ( aDiscussion . path +
381388 ( aDiscussion . duplicateId ? '_' + aDiscussion . duplicateId : '' ) ) ) ;
@@ -408,22 +415,25 @@ exports.comment = function (aReq, aRes, aNext) {
408415 var topic = aReq . params . topic ;
409416
410417 if ( aErr || ! aScript ) {
411- return aNext ( ) ;
418+ aNext ( ) ;
419+ return ;
412420 }
413421
414422 if ( ! content || ! content . trim ( ) ) {
415- return statusCodePage ( aReq , aRes , aNext , {
423+ statusCodePage ( aReq , aRes , aNext , {
416424 statusCode : 403 ,
417425 statusMessage : 'You cannot post an empty comment to this issue'
418426 } ) ;
427+ return ;
419428 }
420429
421430 discussionLib . findDiscussion ( category , topic , function ( aIssue ) {
422431 //
423432 var authedUser = aReq . session . user ;
424433
425434 if ( ! aIssue ) {
426- return aNext ( ) ;
435+ aNext ( ) ;
436+ return ;
427437 }
428438
429439 discussionLib . postComment ( authedUser , aIssue , content , false ,
@@ -449,14 +459,16 @@ exports.changeStatus = function (aReq, aRes, aNext) {
449459 var changed = false ;
450460
451461 if ( aErr || ! aScript ) {
452- return aNext ( ) ;
462+ aNext ( ) ;
463+ return ;
453464 }
454465
455466 discussionLib . findDiscussion ( category , topic , function ( aIssue ) {
456467 var authedUser = aReq . session . user ;
457468
458469 if ( ! aIssue ) {
459- return aNext ( ) ;
470+ aNext ( ) ;
471+ return ;
460472 }
461473
462474 // Both the script author and the issue creator can close the issue
0 commit comments