Use of unassigned variable?

前端 未结 5 1050
Happy的楠姐
Happy的楠姐 2021-01-26 19:04

I\'m getting the error use of unassigned variable \"ps\" when declaring if paymentstatus is null or has value in the \"if\" statement. I\'m thinking that i allready declared ps

5条回答
  •  南方客
    南方客 (楼主)
    2021-01-26 19:34

    You haven't initialized ps...you need to initalize it with at least null value...

    PaymentStatus? ps = null;
    

    The same applies to all other variables

提交回复
热议问题