Do not include null Types in the resulting list

This commit is contained in:
Michael Becker 2015-09-28 11:19:17 -04:00
parent 872a30787d
commit 2423caf68b

View File

@ -35,8 +35,8 @@ namespace UniversalEditor.Common
{
if (mvarAvailableTypes == null)
{
List<Type> types = new List<Type>();
Assembly[] asms = GetAvailableAssemblies();
Type[] types = new Type[0];
foreach (Assembly asm in asms)
{
Type[] types1 = null;
@ -51,10 +51,13 @@ namespace UniversalEditor.Common
if (types1 == null) continue;
Array.Resize<Type>(ref types, types.Length + types1.Length);
Array.Copy(types1, 0, types, types.Length - types1.Length, types1.Length);
foreach (Type type in types1)
{
if (type == null) continue;
types.Add(type);
}
}
mvarAvailableTypes = types;
mvarAvailableTypes = types.ToArray();
}
if (inheritsFrom != null)