carviaso / google-checkout-dotnet-sample-code

Automatically exported from code.google.com/p/google-checkout-dotnet-sample-code
0 stars 0 forks source link

ChargeAmountNotifications List null issue #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm unsure how to reproduce this issue, but it appears the following code 
throws an exception when resp1.ChargeAmountNotifications() is null.

 NotificationHistoryRequest req1 = new NotificationHistoryRequest(orders); 
 NotificationHistoryResponse resp1 = (NotificationHistoryResponse)req1.Send();

   foreach(GCheckout.AutoGen.ChargeAmountNotification can in resp1.ChargeAmountNotifications()) {
//do whatever
}

The following workaround works

   if(resp1.ChargeAmountNotifications() != null) {
   foreach(GCheckout.AutoGen.ChargeAmountNotification can in resp1.ChargeAmountNotifications()) {
//do whatever
}

ERROR MESSAGE:

Thread information: 
    Thread ID: 1 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
   at GCheckout.OrderProcessing.NotificationHistoryResponse.get_NotificationResponses() in E:\work\Google\Checkout\Main\google-checkout-dotnet-sample-code\lib\OrderProcessing\NotificationHistoryResponse.cs:line 116
   at GCheckout.OrderProcessing.NotificationHistoryResponse.GetMessagesOfType[T]() in E:\work\Google\Checkout\Main\google-checkout-dotnet-sample-code\lib\OrderProcessing\NotificationHistoryResponse.cs:line 253
   at GCheckout.OrderProcessing.NotificationHistoryResponse.ChargeAmountNotifications() in E:\work\Google\Checkout\Main\google-checkout-dotnet-sample-code\lib\OrderProcessing\NotificationHistoryResponse.cs:line 146
   at.....

Original issue reported on code.google.com by just4fun...@gmail.com on 14 Oct 2010 at 5:37

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r236.

Original comment by joseph.f...@gmail.com on 16 Oct 2010 at 4:30

GoogleCodeExporter commented 9 years ago

Original comment by joseph.f...@gmail.com on 16 Oct 2010 at 4:30

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 9720a915f155.

Original comment by joseph.f...@gmail.com on 21 Apr 2011 at 5:11