diff --git a/.pyspelling.yml b/.pyspelling.yml
index 07224cf..4cf66ec 100644
--- a/.pyspelling.yml
+++ b/.pyspelling.yml
@@ -19,9 +19,7 @@ matrix:
       - title
       - alt
       ignores:
-      - ':is(code, pre)'
-      - 'a:is(.magiclink-compare, .magiclink-commit, .magiclink-repository)'
-      - 'span.keys'
+      - ':is(code, pre, a.magiclink, span.keys)'
       - ':is(.MathJax_Preview, .md-nav__link, .md-footer-custom-text, .md-source__repository, .headerlink, .md-icon)'
   - pyspelling.filters.url:
 
diff --git a/docs/src/markdown/about/changelog.md b/docs/src/markdown/about/changelog.md
index 2106380..7a2beac 100644
--- a/docs/src/markdown/about/changelog.md
+++ b/docs/src/markdown/about/changelog.md
@@ -4,6 +4,10 @@
 
 - **NEW**: Add support for `:in-range` and `:out-of-range` selectors.
 
+## 1.6.3
+
+- **FIX**: Fix pickling issue when compiled selector contains a `NullSelector` object. (#70)
+
 ## 1.6.2
 
 - **FIX**: Fix pattern compile issues on Python < 2.7.4.
diff --git a/soupsieve/css_types.py b/soupsieve/css_types.py
index 7bb07b5..3f2c997 100644
--- a/soupsieve/css_types.py
+++ b/soupsieve/css_types.py
@@ -2,7 +2,16 @@
 from __future__ import unicode_literals
 from . import util
 
-__all__ = ('Selector', 'SelectorTag', 'SelectorAttribute', 'SelectorNth', 'SelectorList', 'Namespaces')
+__all__ = (
+    'Selector',
+    'NullSelector',
+    'SelectorTag',
+    'SelectorAttribute',
+    'SelectorNth',
+    'SelectorLang',
+    'SelectorList',
+    'Namespaces'
+)
 
 
 SEL_EMPTY = 0x1
@@ -291,8 +300,9 @@ def pickle_register(obj):
 
 
 pickle_register(Selector)
+pickle_register(NullSelector)
 pickle_register(SelectorTag)
 pickle_register(SelectorAttribute)
 pickle_register(SelectorNth)
-pickle_register(SelectorList)
 pickle_register(SelectorLang)
+pickle_register(SelectorList)

Compiled object cannot be pickled if contains a NullSelector object
We forgot to register `NullSelector` to be pickled. So if a compiled selector object contains a `NullSelector`, it will not pickle.
diff --git a/tests/test_soupsieve.py b/tests/test_soupsieve.py
index af94fef..a4943fb 100644
--- a/tests/test_soupsieve.py
+++ b/tests/test_soupsieve.py
@@ -184,17 +184,26 @@ class TestSoupSieve(unittest.TestCase):
         """Test copy and pickle."""
 
         # Test that we can pickle and unpickle
-        p1 = sv.compile('p[id]')
+        # We force a pattern that contains all custom types:
+        # `Selector`, `NullSelector`, `SelectorTag`, `SelectorAttribute`,
+        # `SelectorNth`, `SelectorLang`, `SelectorList`, and `Namespaces`
+        p1 = sv.compile(
+            'p.class#id[id]:nth-child(2):lang(en):focus', {'html': 'http://www.w3.org/TR/html4/'}
+        )
         sp1 = pickle.dumps(p1)
         pp1 = pickle.loads(sp1)
         self.assertTrue(pp1 == p1)
 
         # Test that we pull the same one from cache
-        p2 = sv.compile('p[id]')
+        p2 = sv.compile(
+            'p.class#id[id]:nth-child(2):lang(en):focus', {'html': 'http://www.w3.org/TR/html4/'}
+        )
         self.assertTrue(p1 is p2)
 
         # Test that we compile a new one when providing a different flags
-        p3 = sv.compile('p[id]', flags=0x10)
+        p3 = sv.compile(
+            'p.class#id[id]:nth-child(2):lang(en):focus', {'html': 'http://www.w3.org/TR/html4/'}, flags=0x10
+        )
         self.assertTrue(p1 is not p3)
         self.assertTrue(p1 != p3)
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov coverage lxml beautifulsoup4
apt-get update apt-get install -y gcc
3.9
requirements/project.txt requirements/tests.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
beautifulsoup4==4.13.3
coverage==7.8.0
exceptiongroup==1.2.2
html5lib==1.1
iniconfig==2.1.0
lxml==5.3.1
packaging==24.2
pluggy==1.5.0
pytest==8.3.5
pytest-cov==6.0.0
six==1.17.0
-e git+https://github.com/facelessuser/soupsieve.git@a1511d12ed1e49ff1d3cf3098046230554c703c7#egg=soupsieve
tomli==2.2.1
typing_extensions==4.13.0
webencodings==0.5.1

name: soupsieve
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - beautifulsoup4==4.13.3
      - coverage==7.8.0
      - exceptiongroup==1.2.2
      - html5lib==1.1
      - iniconfig==2.1.0
      - lxml==5.3.1
      - packaging==24.2
      - pluggy==1.5.0
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - six==1.17.0
      - tomli==2.2.1
      - typing-extensions==4.13.0
      - webencodings==0.5.1
prefix: /opt/conda/envs/soupsieve

tests/test_soupsieve.py::TestSoupSieve::test_copy_pickle
tests/test_soupsieve.py::TestSoupSieve::test_cache tests/test_soupsieve.py::TestSoupSieve::test_closest tests/test_soupsieve.py::TestSoupSieve::test_comments tests/test_soupsieve.py::TestSoupSieve::test_filter tests/test_soupsieve.py::TestSoupSieve::test_immutable_dict tests/test_soupsieve.py::TestSoupSieve::test_immutable_object tests/test_soupsieve.py::TestSoupSieve::test_match tests/test_soupsieve.py::TestSoupSieve::test_recompile tests/test_soupsieve.py::TestSoupSieve::test_select tests/test_soupsieve.py::TestInvalid::test_invalid_combination tests/test_soupsieve.py::TestInvalid::test_invalid_incomplete_has tests/test_soupsieve.py::TestInvalid::test_invalid_namespace tests/test_soupsieve.py::TestInvalid::test_invalid_pseudo tests/test_soupsieve.py::TestInvalid::test_invalid_pseudo_close tests/test_soupsieve.py::TestInvalid::test_invalid_pseudo_open tests/test_soupsieve.py::TestInvalid::test_invalid_syntax tests/test_soupsieve.py::TestInvalid::test_invalid_tag tests/test_soupsieve.py::TestInvalid::test_invalid_type_input
soupsieve/css_types.py docs/src/markdown/about/changelog.md .pyspelling.yml
soupsieve/css_types.py docs/src/markdown/about/changelog.md .pyspelling.yml