You need to sign in to do that
Don't have an account?
SivaG
NullPointer Exception
Hi,
I am getting a null pointer exception in controller class for the below line.I assume opportunityQuoteRecordType is having a null value in some scenario. There are 4 options on VF page to select opportunityQuoteRecordType. opportunityQuoteRecordType is defaulted to some value in constructor and its selected in VF page when loads.
How to fix this issue?
queryString += ' and QQ_Plan_Pricing_Mthd_dim__c = \'' + string.escapeSingleQuotes(opportunityQuoteRecordType) + '\'';
Thanks
Kumar
I am getting a null pointer exception in controller class for the below line.I assume opportunityQuoteRecordType is having a null value in some scenario. There are 4 options on VF page to select opportunityQuoteRecordType. opportunityQuoteRecordType is defaulted to some value in constructor and its selected in VF page when loads.
How to fix this issue?
queryString += ' and QQ_Plan_Pricing_Mthd_dim__c = \'' + string.escapeSingleQuotes(opportunityQuoteRecordType) + '\'';
Thanks
Kumar
All Answers
Actually it happened in production. I am not able to recreate the scenario in dev sandbox. I checked the debug log in test and don't see any exception.
As mentioned I can add not NULL check but that would not serve the purpose. If it returns null then we will miss 'and QQ_Plan_Pricing_Mthd_dim__c = Opprectype' condition in query. I am thinking to put this code in try/catch block. And in catch block I will have default record type. What say?
Thanks
Kumar