Skip to content

Commit d789bb1

Browse files
author
pumamood
committed
fix issue #1188
1 parent 4230c1e commit d789bb1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/FirebirdSql.EntityFrameworkCore.Firebird/Scaffolding/Internal/FbDatabaseModelFactory.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,18 @@ private void GetIndexes(DbConnection connection, IReadOnlyList<DatabaseTable> ta
343343
Name = reader.GetString(0).Trim(),
344344
IsUnique = reader.GetBoolean(1),
345345
};
346-
346+
bool skipIdx = false;
347347
foreach (var column in reader.GetString(3).Split(','))
348348
{
349-
index.Columns.Add(table.Columns.Single(y => y.Name == column.Trim()));
349+
var col = table.Columns.SingleOrDefault(y => y.Name == column.Trim());
350+
if (col == null)
351+
{
352+
skipIdx = true;
353+
break;
354+
}
355+
index.Columns.Add(col);
350356
}
357+
if(skipIdx) continue;
351358

352359
if (reader.GetBoolean(2))
353360
{

0 commit comments

Comments
 (0)