diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-03-21 16:58:41 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-03-21 16:58:41 +0100 |
| commit | 7fec9c10af8dfd3856fcf2c14d61386fefb57dfc (patch) | |
| tree | 6be9752edd74bec99922a953b36ac785b11882a3 | |
| parent | 56cdd18ff289f9f730465cbd50a0bc9f3c6a0bc6 (diff) | |
| download | bridge-7fec9c10af8dfd3856fcf2c14d61386fefb57dfc.tar.gz bridge-7fec9c10af8dfd3856fcf2c14d61386fefb57dfc.zip | |
handle lmcd=null
| -rw-r--r-- | api.js | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -94,7 +94,9 @@ app.get("/api/player/:name", async (req, res) => { player_region = player.rows[0].shard_id; grab_start = player.rows[0].last_match_created_date; // TODO db does not save time zone offset @stormcaller remove this - grab_start.setMinutes(grab_start.getMinutes() - (new Date().getTimezoneOffset())); + if (grab_start != undefined) + grab_start.setMinutes(grab_start.getMinutes() - + (new Date().getTimezoneOffset())); } /* not found */ if (player.rows.length == 0) { @@ -110,6 +112,8 @@ app.get("/api/player/:name", async (req, res) => { player_id = player.id; player_region = player.region; + } + if (grab_start == undefined) { grab_start = new Date("2017-01-01T00:00:00Z"); } |
