Merge pull request #619 from letsencrypt/handle_serial

handle empty serial number table a bit better
This commit is contained in:
Jacob Hoffman-Andrews 2015-08-14 12:58:05 -07:00
commit 3363646893
1 changed files with 6 additions and 1 deletions

View File

@ -84,7 +84,12 @@ func (cadb *CertificateAuthorityDatabaseImpl) IncrementAndGetSerial(tx *gorp.Tra
return
}
row := rowObj.(*SerialNumber)
row, ok := rowObj.(*SerialNumber)
if !ok {
err = fmt.Errorf("No serial number found. This is a serious issue")
return
}
val = row.Number
row.Number = val + 1