Track down and fix null reference exceptions and null pointer errors
Help me fix a null reference/null pointer exception in my code.
**Error message:**
```
{{ERROR_MESSAGE}}
```
**Code where the error occurs:**
```{{LANGUAGE}}
{{CODE}}
```
**Programming Language:** {{LANGUAGE}}
**What should the variable contain:** {{EXPECTED_VALUE}}
Please provide:
1. **Null Source Identification**: Trace back to where the null value originates
2. **Code Flow Analysis**: Show the execution path that leads to the null
3. **Defensive Coding Fix**: Add proper null checks and guards
4. **Null Object Pattern**: Suggest null object pattern if applicable
5. **Optional/Maybe Types**: Recommend type-safe null handling if language supports it
6. **Prevention Strategies**: How to prevent null references at design level
7. **Testing Recommendations**: Tests to catch null reference issuesOr press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{ERROR_MESSAGE][{LANGUAGE][{CODE][{EXPECTED_VALUE]