Skip to content

Commit

Permalink
Fixed NullReferenceException when Row.CreateKey() was called.
Browse files Browse the repository at this point in the history
  • Loading branch information
ammachado committed Apr 1, 2010
1 parent 7cc19b8 commit 328e441
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Rhino.Etl.Core/Row.cs
Expand Up @@ -123,7 +123,7 @@ public bool Equals(Row other)
/// </summary>
public ObjectArrayKeys CreateKey()
{
return CreateKey(null);
return CreateKey(Columns.ToArray());
}

/// <summary>
Expand Down
11 changes: 11 additions & 0 deletions Rhino.Etl.Tests/RowTest.cs
Expand Up @@ -2,6 +2,7 @@
using Xunit;
using Rhino.Etl.Core;
using Xunit.Extensions;
using System.Linq;

namespace Rhino.Etl.Tests
{
Expand Down Expand Up @@ -84,5 +85,15 @@ private static Row FillRow(string[] columns, object[] values)

return row;
}

[Fact]
public void Can_generate_ObjectArrayKeys_without_specifying_column_names()
{
Row row = new Row();

row["a"] = 1;

Assert.DoesNotThrow(() => row.CreateKey());
}
}
}

0 comments on commit 328e441

Please sign in to comment.