Permalink
Browse files

Resolving [LIBOMV-567]. libomv now throws a helpful error and a stack…

… trace when a packet cannot be serialized because of null blocks

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2886 52acb1d6-8a22-11de-b505-999d5b087335
  • Loading branch information...
1 parent 75cdaf8 commit d0a9c6401f4ca7becb4add3c237d914db78adbd9 @jhurliman jhurliman committed Jun 15, 2009
Showing with 1,174 additions and 833 deletions.
  1. +8 −1 OpenMetaverse/Simulator.cs
  2. +1,153 −823 OpenMetaverse/_Packets_.cs
  3. +13 −9 Programs/mapgenerator/mapgenerator.cs
@@ -649,7 +649,14 @@ public void SendPacket(Packet packet)
if (packet.HasVariableBlocks)
{
- byte[][] datas = packet.ToBytesMultiple();
+ byte[][] datas;
+ try { datas = packet.ToBytesMultiple(); }
+ catch (NullReferenceException)
+ {
+ Logger.Log("Failed to serialize " + packet.Type + " packet to one or more payloads due to a missing block or field. StackTrace: " +
+ Environment.StackTrace, Helpers.LogLevel.Error);
+ return;
+ }
int packetCount = datas.Length;
if (packetCount > 1)
Oops, something went wrong.

0 comments on commit d0a9c64

Please sign in to comment.