I have below code where I face null pointer exception when the custom settings data is not populated. I simply need to ignore if it's null rather than getting an exception in this trigger code.
Can someone suggest a way out?
Apex Code:
Abbvie_Custom_Settings__c settings = Abbvie_Custom_Settings__c.getInstance('Main');
String AllowedProfiles= settings.Allowed_Profiles_abv__c;
string[] part;
String profile='';
part = AllowedProfiles.split(','); // This line throws null pointer exception