Skip to content

Commit 0a91b3d

Browse files
authored
Merge pull request #361 from topcoder-platform/develop
Hotfix for error seen in log
2 parents 80b8476 + 8192c76 commit 0a91b3d

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/common/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ async function fetchFromES (query, resource) {
244244
const docs = await osClient.search({
245245
index: config.get('osConfig.OS_INDEX'),
246246
body: filter
247-
})
247+
})
248248

249249
// Extract data from hits
250250
const rows = _.map(docs.body.hits.hits, single => single._source)

src/common/informixHelper.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Contains Informix helper methods for loading reviews from Informix
2+
* Contains Informix helper methods for loading reviews from Informix
33
*/
44
const config = require('config')
55
const logger = require('./logger')
@@ -41,6 +41,10 @@ async function loadOnlineReviewDetails (authUser, submission) {
4141

4242
const reviews = queryInformix(query)
4343

44+
if (!reviews) {
45+
return
46+
}
47+
4448
for await (const dbReview of reviews) {
4549
if (!submission.review) {
4650
submission.review = []

src/services/SubmissionService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ async function countSubmissions (challengeId) {
765765
result = await osClient.search({
766766
index: config.get('osConfig.OS_INDEX'),
767767
body: esQuery
768-
})
768+
})
769769
} catch (err) {
770770
logger.error(`Get Submission Count Error ${JSON.stringify(err)}`)
771771
throw err

0 commit comments

Comments
 (0)