Skip to content

Commit 0c29314

Browse files
committed
guarded against UniqueInteger undefined usage
1 parent 2108e49 commit 0c29314

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NHibernate/Mapping/Table.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class Table : IRelationalModel
3030
private readonly LinkedHashMap<string, Column> columns = new LinkedHashMap<string, Column>();
3131
private readonly Dictionary<ForeignKeyKey, ForeignKey> foreignKeys = new Dictionary<ForeignKeyKey, ForeignKey>();
3232
private readonly Dictionary<string, Index> indexes = new Dictionary<string, Index>();
33-
private int uniqueInteger;
33+
private int? uniqueInteger;
3434
private readonly Dictionary<string, UniqueKey> uniqueKeys = new Dictionary<string, UniqueKey>();
3535
private string catalog;
3636
private string comment;
@@ -189,7 +189,7 @@ public string Schema
189189
/// <value>The unique number of the Table.</value>
190190
public int UniqueInteger
191191
{
192-
get { return uniqueInteger; }
192+
get { return uniqueInteger ?? throw new InvalidOperationException(nameof(UniqueInteger) + " has not been supplied"); }
193193
internal set { uniqueInteger = value; }
194194
}
195195

0 commit comments

Comments
 (0)