I have a code to in controller and I am trying to get the value from the map. Here is the code 

```
public Map<String, Integer> daysOfTheWeekMap = new Map<String, Integer>();
daysOfTheWeekMap=assignDaysOfWeekMap();
if (daysOfTheWeekMap.get(dayOfWeek) - daysOfTheWeekMap.get(recurringTaskLPP.daysOfWeek[i]) <= 0) {
                days.add(startDate);
                startDate = startDate + (this.daysOfTheWeekMap.get(dayOfWeek) - this.daysOfTheWeekMap.get(recurringTaskLPP.daysOfWeek[i]));
            }
 public Map<String, Integer> assignDaysOfWeekMap() {
        Map<String,Integer> weekMap = new Map<String, Integer>();
        this.daysOfTheWeekMap.put('Sunday',0);
        this.daysOfTheWeekMap.put('Monday',1);
        this.daysOfTheWeekMap.put('Tuesday',2);
        this.daysOfTheWeekMap.put('Wednesday',3);
        this.daysOfTheWeekMap.put('Thursday',4);
        this.daysOfTheWeekMap.put('Friday',5);
        this.daysOfTheWeekMap.put('Saturday',6);
        return weekMap;
    }

```

Whenever i try and run I get the error in the If statement that I am trying to dereference the null object. The problem is that when dayOfWeek is passed in the map to get the value the map is returning null. When I log dayOfWeek it shows the correct value which means that the problem is in the get from the map. Can anyone solve and tell me why is it giving a null pointer exception in get from the map?? Thanks