diff --git a/Marr.Data/DataHelper.cs b/Marr.Data/DataHelper.cs index 721511a2a..d5120894b 100644 --- a/Marr.Data/DataHelper.cs +++ b/Marr.Data/DataHelper.cs @@ -84,6 +84,12 @@ public static string GetColumnName(Type declaringType, string propertyName, bool string columnName = propertyName; var columnMap = MapRepository.Instance.GetColumns(declaringType).GetByFieldName(propertyName); + + if (columnMap == null) + { + throw new InvalidOperationException(string.Format("Column map missing for field {0}.{1}", declaringType.FullName, propertyName)); + } + if (useAltName) { columnName = columnMap.ColumnInfo.TryGetAltName();