Archived
This forum has been archived. Please start a new discussion on GitHub.
C#: callback (ice_response) problem
kwaclaw
Oshawa, Canada
in Bug Reports
I am getting a null pointer exception in the C# generated code when ice_response is called in an async dispatch situation.
The relevant Slice is:
The generated code for the call-back is as follows:
(I have marked the problem spot with a comment)
The problem occurs when the returned array contains nulls.
Karl
The relevant Slice is:
struct Prop { int Index; Ice::ByteSeq Value; }; sequence<Prop> PropSeq; interface Store { . . . ["ami", "amd"] idempotent PropSeq Get(Ice::ByteSeq key, Ice::IntSeq propIndexes) throws ServiceError; . . . };
The generated code for the call-back is as follows:
(I have marked the problem spot with a comment)
class _AMD_Store_Get : IceInternal.IncomingAsync, AMD_Store_Get { public _AMD_Store_Get(IceInternal.Incoming inc) : base(inc) { } public void ice_response(Services.StorageServices.Prop[] ret__) { try { IceInternal.BasicStream os__ = this.os__(); if(ret__ == null) { os__.writeSize(0); } else { os__.writeSize(ret__.Length); for(int ix__ = 0; ix__ < ret__.Length; ++ix__) { ret__[ix__].write__(os__); // issue here } } } catch(Ice.LocalException ex__) { ice_exception(ex__); } response__(true); } public void ice_exception(_System.Exception ex) { try { throw ex; } catch(Services.ServiceError ex__) { os__().writeUserException(ex__); response__(false); } catch(_System.Exception ex__) { exception__(ex__); } } }
The problem occurs when the returned array contains nulls.
Karl
0
Comments
-
Thanks for the bug report. I'll post a patch ASAP.
Cheers,
Michi.0