mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 22:41:46 +00:00
added a check to handle invalid DLLs in the Plugins directory
This commit is contained in:
parent
5adaf2ee4b
commit
c9ba627df5
1 changed files with 11 additions and 3 deletions
|
@ -70,8 +70,16 @@ namespace CodeImp.DoomBuilder.Plugins
|
|||
name = Path.GetFileNameWithoutExtension(filename);
|
||||
General.WriteLogLine("Loading plugin '" + name + "' from '" + Path.GetFileName(filename) + "'...");
|
||||
|
||||
// Load assembly
|
||||
asm = Assembly.LoadFile(filename);
|
||||
try
|
||||
{
|
||||
// Load assembly
|
||||
asm = Assembly.LoadFile(filename);
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
General.WriteLogLine("ERROR: Could not load plugin '" + name + "', the DLL file could not be read!");
|
||||
throw new InvalidProgramException();
|
||||
}
|
||||
|
||||
// Find the class that inherits from Plugin
|
||||
Type t = FindSingleClass(typeof(Plug));
|
||||
|
|
Loading…
Reference in a new issue