Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I really need some help with this because it's really driving me mad. I had two jobs which previously (around a week ago) were running perfectly. I haven't changed the input file or anything else. Today I go to run it and it produces the dreaded java.lang.NullPointerException error.
I have an excel input file. I think what's causing the issue is this part in my tMap
row2.CountryCode.equals("")?
"MAIN_PURCH" :
(row2.CountryCode.equals("GB"))&&row1.Postcode!=null ?
row1.Postcode :
row2.CountryCode+"_MAIN_PURCH"
What I'm saying here is if the country code is blank, then MAIN_PURCH, else if
the country code is GB and the postcode is not null then use the postcode, else
Country Code+Main_PURCH
Appreciate any input!
I imagine I'm going to be told there's null values in my source data, but what I don't understand is that I haven't changed the input file & it was running before.
Try this...
row2.CountryCode==null || row2.CountryCode.equals("")?
"MAIN_PURCH" :
(row2.CountryCode.equals("GB"))&&row1.Postcode!=null ?
row1.Postcode :
row2.CountryCode+"_MAIN_PURCH"
It sounds like your CountryCode may be null instead of an empty String.
Try this...
row2.CountryCode==null || row2.CountryCode.equals("")?
"MAIN_PURCH" :
(row2.CountryCode.equals("GB"))&&row1.Postcode!=null ?
row1.Postcode :
row2.CountryCode+"_MAIN_PURCH"
It sounds like your CountryCode may be null instead of an empty String.
Try this...
row2.CountryCode==null || row2.CountryCode.equals("")?
"MAIN_PURCH" :
(row2.CountryCode.equals("GB"))&&row1.Postcode!=null ?
row1.Postcode :
row2.CountryCode+"_MAIN_PURCH"
It sounds like your CountryCode may be null instead of an empty String.
That's worked, thank you!
That's worked, thank you!