Skip to content

Commit

Permalink
Better exception handling for _columnItemsTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
VahidN committed Jan 17, 2019
1 parent 84b1821 commit 5e7a852
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/PdfRpt.Core/FluentInterface/ColumnItemsTemplateBuilder.cs
Expand Up @@ -50,6 +50,11 @@ public void CustomTemplate(IColumnItemsTemplate columnItemsTemplate)
/// </summary>
public void DisplayFormatFormula(Func<object, string> formula)
{
if (_columnItemsTemplate == null)
{
throw new InvalidOperationException("`ColumnItemsTemplate` is null. You should configure how to display this cell's data, such as `template.TextBlock();`.");
}

if (_columnItemsTemplate.BasicProperties == null)
_columnItemsTemplate.BasicProperties = new CellBasicProperties();

Expand Down
2 changes: 1 addition & 1 deletion src/PdfRpt.Core/PdfRpt.Core.csproj
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>PdfReport.Core is a code first reporting engine, which is built on top of the iTextSharp.LGPLv2.Core and EPPlus.Core libraries.</Description>
<VersionPrefix>1.2.4</VersionPrefix>
<VersionPrefix>1.2.5</VersionPrefix>
<Authors>Vahid Nasiri</Authors>
<TargetFrameworks>net40;netstandard1.6;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down

0 comments on commit 5e7a852

Please sign in to comment.