Skip to content

Commit

Permalink
issue/hitide-profile-45: fixed parsing error for history
Browse files Browse the repository at this point in the history
  • Loading branch information
jbyrne committed Jun 17, 2024
1 parent ed22986 commit 684dcca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion server/util/history-db.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,15 @@ function convertDbJobToJsJob(dbJob) {
}

if(jsonProperties[jsKey]) {
value = JSON.parse(value);
// if string is not valid json, convert it to valid json.
try {
value = JSON.parse(value);
} catch(error) {
if(dbKey === 'download_urls') {
value = ['https://harmony.earthdata.nasa.gov/jobs/' + dbJob['token']]
}
}

}

jsJob[jsKey] = value;
Expand Down

0 comments on commit 684dcca

Please sign in to comment.