/[gr2lib]/trunk/gr2lib/core/coretypes/implementation/Skeleton.cs
ViewVC logotype

Diff of /trunk/gr2lib/core/coretypes/implementation/Skeleton.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/gr2lib/core/coretypes/implementation/Skeleton.cs	2010/07/16 21:26:08	83
+++ trunk/gr2lib/core/coretypes/implementation/Skeleton.cs	2010/07/16 23:35:21	86
@@ -22,15 +22,25 @@
 
         internal static Skeleton ReadFromMemory(IntPtr pointer)
         {
+            try
+            {
             if (pointer == IntPtr.Zero) return null;
             native.Skeleton native = Helpers.ReadFromMemory<native.Skeleton>(pointer);
             Skeleton managed = ReadFromNative(native);
             managed.NativePointer = pointer;
             return managed;
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.ToString());
+                return default(Skeleton);
+            }
         }
 
         internal static Skeleton ReadFromNative(native.Skeleton native)
         {
+            try
+            {
             Skeleton managed = new Skeleton();
             managed.SkeletonName = string.IsNullOrEmpty(native.Name) ? "{null}" : native.Name;
             IntPtr[] bones = Helpers.ReadPtrArrayFromMemory<native.Bone>(native.Bones);
@@ -48,6 +58,12 @@
             managed.LodType = native.LodType;
             managed.ExtendedData = native.ExtendedData;
             return managed;
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.ToString());
+                return default(Skeleton);
+            }
         }
 
         #region ISkeleton Members

 

  ViewVC Help
Powered by ViewVC 1.1.22