1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-26 01:27:00 +00:00

added check for marr data to throw a more meaning full exception when trying to operate on an unmapped column.

This commit is contained in:
kay.one 2013-04-11 08:16:34 -07:00
parent 2f42e7dd83
commit bfb167c374

View file

@ -84,6 +84,12 @@ public static string GetColumnName(Type declaringType, string propertyName, bool
string columnName = propertyName; string columnName = propertyName;
var columnMap = MapRepository.Instance.GetColumns(declaringType).GetByFieldName(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) if (useAltName)
{ {
columnName = columnMap.ColumnInfo.TryGetAltName(); columnName = columnMap.ColumnInfo.TryGetAltName();