Skip to content

Commit

Permalink
fix(jobs): null check jobs for id
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno committed Dec 15, 2020
1 parent 963ee32 commit 70382c9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
2 changes: 1 addition & 1 deletion lib/SyndicateJob.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class SyndicateJob extends WorldstateObject {
* @param {string} deps.locale Locale to use for translations
*/
constructor(data, expiry, { translator, timeDate, locale }) {
super({ _id: { $oid: data.JobCurrentVersion ? data.JobCurrentVersion.$oid : `${data.jobType.split('/').slice(-1)[0]}${expiry.getTime()}` } }, { timeDate });
super({ _id: { $oid: data.JobCurrentVersion ? data.JobCurrentVersion.$oid : `${(data.jobType || '').split('/').slice(-1)[0]}${expiry.getTime()}` } }, { timeDate });

/**
* Array of strings describing rewards
Expand Down
46 changes: 28 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,44 @@
"release": {
"branch": "master"
},
"eslintIgnore": [".github/**", "docs/**", "resources/**", "types/**"],
"eslintIgnore": [
".github/**",
"docs/**",
"resources/**",
"types/**"
],
"eslintConfig": {
"extends": "airbnb-base",
"parserOptions": {
"sourceType": "script"
},
"rules": {
"valid-jsdoc": ["error", {
"requireReturn": false,
"requireReturnDescription": false,
"preferType": {
"String": "string",
"Number": "number",
"Boolean": "boolean",
"Function": "function",
"object": "Object",
"date": "Date",
"error": "Error"
},
"prefer": {
"return": "returns"
"valid-jsdoc": [
"error",
{
"requireReturn": false,
"requireReturnDescription": false,
"preferType": {
"String": "string",
"Number": "number",
"Boolean": "boolean",
"Function": "function",
"object": "Object",
"date": "Date",
"error": "Error"
},
"prefer": {
"return": "returns"
}
}
}],
],
"no-underscore-dangle": "off",
"strict": ["error", "safe"],
"strict": [
"error",
"safe"
],
"linebreak-style": "off",
"import/no-unresolved": 0
}
}

}

0 comments on commit 70382c9

Please sign in to comment.