Question: I am trying to get fields from Contact into fieldset. but i am not bale to get the fields properly i am getting error : Attempt to de-reference a null object

my code :

```
     public class DemoCtrl{

     public contact DemoCtrl { get; set; }

     public List<schema.fieldsetmember> getACTFields(){ 
             // System.debug('getField ' + Fields);     
             return getFields('contact', 'ACT');
     }

       public static List<schema.fieldsetmember> getFields(String objectName, String fieldSetName) 
      {  

        Map<String, Schema.SObjectType> GlobalDescribeMap = Schema.getGlobalDescribe(); 
        Schema.SObjectType SObjectTypeObj = GlobalDescribeMap.get(objectName);
        Schema.DescribeSObjectResult DescribeSObjectResultObj = SObjectTypeObj.getDescribe();            
         Schema.FieldSet fieldSetObj = DescribeSObjectResultObj.FieldSets.getMap().get(fieldSetName);
         //DescribeSObjectResultObj.FieldSets.getMap().get(fieldSetName);        

          System.debug('GlobalDescribeMap ' + GlobalDescribeMap);
         System.debug(' SObjectTypeObj  ' + SObjectTypeObj );
          System.debug('DescribeSObjectResultObj ' +          DescribeSObjectResultObj.FieldSets.getMap().get(fieldSetName)); 
         System.debug('fieldSetObj  ' + fieldSetObj ); 
        return fieldSetObj.getFields();        

     }      

   }

```

I am getting null into DescribeSObjectResultObj.FieldSets.getMap().get(fieldSetName).
Can anybody guide me what is the issue it is not getting filled.

Answer: 
Your code works for me. Like,

DemoCtrl.getFields('Contact', 'FieldSet\_Name');

But if you use Field Label of FieldSet in the call, you will get the error.

By any chance, have your used a label name but not the API name to call your field set?
If you put a System.debug on the fieldsetName and verify if the field set Name is correct, you may be able to find out the problem.