From bfb167c374f854b0a185ac749bfd0fb5aea5032a Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Thu, 11 Apr 2013 08:16:34 -0700 Subject: [PATCH] added check for marr data to throw a more meaning full exception when trying to operate on an unmapped column. --- Marr.Data/DataHelper.cs | 6 ++++++ 1 file changed, 6 insertions(+) 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 @@ namespace Marr.Data 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();