Skip to content

Commit 80f7531

Browse files
committed
Better null handling in MappingVisitor
Closes #1068
1 parent c07c4d2 commit 80f7531

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Nest/DSL/Visitor/MappingWalker.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@ public class MappingWalker
88

99
public MappingWalker(IMappingVisitor visitor)
1010
{
11+
visitor.ThrowIfNull("visitor");
1112
_visitor = visitor;
1213
}
1314

1415
public void Accept(IGetMappingResponse response)
1516
{
17+
if (response == null) return;
1618
this.Accept(response.Mapping);
1719
}
1820

1921
public void Accept(RootObjectMapping mapping)
2022
{
23+
if (mapping == null) return;
2124
this._visitor.Visit(mapping);
2225
this.Accept(mapping.Properties);
2326
}

0 commit comments

Comments
 (0)