Skip to content

Commit f26da3a

Browse files
committed
Defensive programming for GetEntryAssembly to see if tests on build server works better
1 parent a9d6d69 commit f26da3a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Src/NHibernate.Envers.Tests/Setup.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ public class Setup
1414
public void RunOnce()
1515
{
1616
var log4netConf = new FileInfo(Environment.CurrentDirectory + @"\log4net.xml");
17-
var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
18-
XmlConfigurator.Configure(logRepository, log4netConf);
17+
var entryAssembly = Assembly.GetEntryAssembly();
18+
if (entryAssembly != null)
19+
{
20+
var logRepository = LogManager.GetRepository(entryAssembly);
21+
XmlConfigurator.Configure(logRepository, log4netConf);
22+
}
1923
}
2024
}
2125
}

0 commit comments

Comments
 (0)