{
  "id": "python/starlette-query-params-none",
  "signature": "AttributeError: 'NoneType' object has no attribute 'get'",
  "signature_zh": "属性错误：'NoneType'对象没有'get'属性。",
  "regex": "AttributeError:\\ 'NoneType'\\ object\\ has\\ no\\ attribute\\ 'get'",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "尝试在None类型的查询参数上调用方法，通常因为参数未提供。",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试在None类型的查询参数上调用方法，通常因为参数未提供。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "尝试直接使用request.query_params['key']但键不存在。",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "忽略None检查。",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "使用get方法：\nparam = request.query_params.get('key')\nif param is not None:\n    # 使用param",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "提供默认值：\nparam = request.query_params.get('key', 'default')",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2026-02-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}