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
|
@ -69,10 +69,18 @@ namespace CodeImp.DoomBuilder.Plugins
|
||||||
// Initialize
|
// Initialize
|
||||||
name = Path.GetFileNameWithoutExtension(filename);
|
name = Path.GetFileNameWithoutExtension(filename);
|
||||||
General.WriteLogLine("Loading plugin '" + name + "' from '" + Path.GetFileName(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
|
// Find the class that inherits from Plugin
|
||||||
Type t = FindSingleClass(typeof(Plug));
|
Type t = FindSingleClass(typeof(Plug));
|
||||||
if(t != null)
|
if(t != null)
|
||||||
|
|
Loading…
Reference in a new issue