Skip to content

Commit 33a23a9

Browse files
committed
Fix a bug when inserting a name less node
1 parent eab151a commit 33a23a9

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
1818
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
1919

20-
[assembly: AssemblyVersion("2.1.4")]
20+
[assembly: AssemblyVersion("2.1.5")]
2121

2222
// The following attributes are used to specify the signing key for the assembly,
2323
// if desired. See the Mono documentation for more information about signing.

Tests/NameLessNode.cfg

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
MMTEST
2+
{
3+
name = NameLessNode
4+
}
5+
6+
@MMTEST[NameLessNode]
7+
{
8+
// Insert a name Less node
9+
%MODEL {
10+
%key = value
11+
}
12+
}
13+
14+
MMTEST_EXPECT
15+
{
16+
MMTEST
17+
{
18+
name = NameLessNode
19+
MODEL
20+
{
21+
key = value
22+
}
23+
}
24+
}

moduleManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,7 @@ public static ConfigNode FindConfigNodeIn(ConfigNode src, string nodeType,
10921092
string nodeName = null, int index = 0)
10931093
{
10941094
ConfigNode [] nodes = src.GetNodes(nodeType);
1095+
if (nodes.Length == 0) return null;
10951096
if (nodeName == null)
10961097
{
10971098
if(index >= 0)

0 commit comments

Comments
 (0)