# AttributeError: 'NoneType' object has no attribute 'get'

- **ID:** `python/starlette-query-params-none`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

尝试在None类型的查询参数上调用方法，通常因为参数未提供。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   使用get方法：
param = request.query_params.get('key')
if param is not None:
    # 使用param
   ```
2. **** (90% success)
   ```
   提供默认值：
param = request.query_params.get('key', 'default')
   ```

## Dead Ends

- **** — 尝试直接使用request.query_params['key']但键不存在。 (80% fail)
- **** — 忽略None检查。 (70% fail)
