Only log not found blocks
This commit is contained in:
@@ -140,7 +140,8 @@ public class Reader {
|
||||
blockOffset += t.GetCustomAttribute<DNAClassAttribute>()!.Size;
|
||||
}
|
||||
}
|
||||
foreach (var obj in objects) {
|
||||
for(int i=0; i<Objects.Count; i++) {
|
||||
var obj = Objects.ElementAt(i);
|
||||
// for each converted object
|
||||
// get the fields of the object
|
||||
FieldInfo[] fieldInfo = obj.Value.GetType().GetFields();
|
||||
@@ -167,7 +168,15 @@ public class Reader {
|
||||
{
|
||||
newobj = ActivateInstance(f.FieldType);
|
||||
if (newobj != null) {
|
||||
FillObject(addr, ref newobj, f.FieldType.GetFields());
|
||||
try
|
||||
{
|
||||
FillObject(addr, ref newobj, f.FieldType.GetFields());
|
||||
} catch (Exception e)
|
||||
{
|
||||
Console.WriteLine($"Error while filling object {f.FieldType.Name}: {e}");
|
||||
continue;
|
||||
}
|
||||
|
||||
f.SetValue(obj.Value, newobj);
|
||||
} // should never happen
|
||||
else throw new NotSupportedException($"Type \"{f.FieldType}\" is unknown");
|
||||
|
||||
Reference in New Issue
Block a user