summaryrefslogtreecommitdiffstats
path: root/editattachstatuses.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'editattachstatuses.cgi')
-rwxr-xr-xeditattachstatuses.cgi3
1 files changed, 2 insertions, 1 deletions
diff --git a/editattachstatuses.cgi b/editattachstatuses.cgi
index f4176a321..3929940f2 100755
--- a/editattachstatuses.cgi
+++ b/editattachstatuses.cgi
@@ -239,7 +239,8 @@ sub insert
SendSQL("LOCK TABLES attachstatusdefs WRITE");
SendSQL("SELECT MAX(id) FROM attachstatusdefs");
- my $id = FetchSQLData() + 1;
+ my $id = FetchSQLData() || 0;
+ $id++;
SendSQL("INSERT INTO attachstatusdefs (id, name, description, sortkey, product)
VALUES ($id, $name, $desc, $::FORM{'sortkey'}, $product)");
SendSQL("UNLOCK TABLES");