Deluge - if no record found set value to 0

Deluge - if no record found set value to 0

Hi there

I'm using the following code

  1. //Get the discount amount based on the discount code
  2. fetchdiscount  =  DTKC_Discount_Configuration  [Discount_Code == input.Discount_Code];
  3. input.Discount_Amount = fetchdiscount.Discount_Amount;
  4. input.TOTAL_TO_PAY = (input.Total_Cost_Before_Any_Discount  -  input.Discount_Amount);

My question is - if there is no match for Discount Code, how do I force the input.Discount Amount to be 0

At the moment if there is no match I get an error saying something to the effect of can't calculate a null value.

Cheers
Aaron