Skip to content

Commit

Permalink
Fix: gNUM_geodatasets - ensure no NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed Oct 30, 2024
1 parent 924f9db commit 066447a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions API/Backend/Geodatasets/models/geodatasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ function makeNewGeodatasetTable(
sequelize
.query("SELECT MAX(id) FROM geodatasets")
.then(([results]) => {
let newTable =
"g" + (parseInt(results[0].max) + 1) + "_geodatasets";
const max = parseInt(results[0].max);
let newTable = "g" + ((isNaN(max) ? 0 : max) + 1) + "_geodatasets";

Geodatasets.create({
name: name,
Expand Down

0 comments on commit 066447a

Please sign in to comment.