求解释一个蛋疼的bug

 大婶儿们出来解决个问题,看看有碰见过的没


截图中的

if (order.EShopOrder_PayStatus == 0 && order.EShopOrder_Status == 0 &&
totalFee >= order.EShopOrder_OrderPrice)条件判断

,由于在测试环境下(谁也不傻,用0.01元支付测试下,因为这淘宝账号是自己滴,花钱心痛啊),所以totalFee >= order.EShopOrder_OrderPrice条件是不满足的,实际支付的钱可能是200元,但我只付了0.01元哦
是不满足这个条件的,但只是为了测试,跳过该条件继续往下走(拖动断点),这时List<EShop_UserSell> list = AddUserSell(order, detaliList);  
        private List<EShop_UserSell> AddUserSell(EShop_Order order, IEnumerable<EShop_OrderDetails> list)
        {
            List<EShop_UserSell> rtnList = new List<EShop_UserSell>();
            foreach (var d in list)
            {
                EShop_UserSell usersell = new EShop_UserSell();
                usersell.EShopOrder_OrderCode = d.EShopOrderCode;
                usersell.Erp_ColorID = d.Erp_ColorID;
                usersell.Erp_SizeID = d.Erp_SizeID;
                usersell.ProducPicUrl = d.EShopOrderDetails_ProducPicUrl;
                usersell.ProductHTML_Code = d.Product_Code;
                usersell.ProductHTML_FormatShowName = d.EShopOrderDetails_ProductName;
                usersell.Sell_AddDate = DateTime.Now;
                usersell.Sell_ColorName = d.EShopOrderDetails_ColorName;
                usersell.Sell_ID = 0;
                usersell.Sell_Price = d.EShopOrderDetails_Prices;
                usersell.Sell_PriceSum = d.EShopOrderDetails_PricesSum;
                usersell.Sell_Quantity = d.EShopOrderDetails_Quantity;
                usersell.Sell_SizeName = d.EShopOrderDetails_SizeName;
                usersell.UserCode = order.EShopOrder_UserCode;

                rtnList.Add(usersell);
            }
            return rtnList;
        }

方法很简单,也调试进去了,完全没有问题,但是调用完成后会报空引用异常。

注释掉if的判断,则完全正常。求解释

1(猜测是不是拖动断点会有什么影响,没查到相关信息,感觉不科学啊)

posted on 2014-07-23 10:09  Super Cow  阅读(192)  评论(0编辑  收藏  举报

导航