Repository: pydicom/pydicom

Issue:
apply_color_lut() incorrect exception when missing RedPaletteColorLUTDescriptor
**Describe the bug**
`AttributeError` when used on a dataset without `RedPaletteColorLookupTableDescriptor `

**Expected behavior**
Should raise `ValueError` for consistency with later exceptions

**Steps To Reproduce**
```python
from pydicom.pixel_data_handlers.util import apply_color_lut
ds = dcmread("CT_small.dcm")
arr = ds.apply_color_lut(arr, ds)
```
```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../pydicom/pixel_data_handlers/util.py", line 116, in apply_color_lut
    lut_desc = ds.RedPaletteColorLookupTableDescriptor
  File ".../pydicom/dataset.py", line 768, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'FileDataset' object has no attribute 'RedPaletteColorLookupTableDescriptor'
```

Discussion:

Patch:
diff --git a/pydicom/pixel_data_handlers/util.py b/pydicom/pixel_data_handlers/util.py
index cacbe2c88..5c80ec06f 100644
--- a/pydicom/pixel_data_handlers/util.py
+++ b/pydicom/pixel_data_handlers/util.py
@@ -112,6 +112,9 @@ def apply_color_lut(arr, ds=None, palette=None):
             "Table Module is not currently supported"
         )
 
+    if 'RedPaletteColorLookupTableDescriptor' not in ds:
+        raise ValueError("No suitable Palette Color Lookup Table Module found")
+
     # All channels are supposed to be identical
     lut_desc = ds.RedPaletteColorLookupTableDescriptor
     # A value of 0 = 2^16 entries


Test patch:
diff --git a/pydicom/tests/test_handler_util.py b/pydicom/tests/test_handler_util.py
index a7c1f4c96..4894a7aed 100644
--- a/pydicom/tests/test_handler_util.py
+++ b/pydicom/tests/test_handler_util.py
@@ -1150,6 +1150,15 @@ class TestNumpy_PaletteColor(object):
         assert [60160, 25600, 37376] == list(rgb[arr == 130][0])
         assert ([60160, 25600, 37376] == rgb[arr == 130]).all()
 
+    def test_unchanged(self):
+        """Test dataset with no LUT is unchanged."""
+        # Regression test for #1068
+        ds = dcmread(MOD_16, force=True)
+        assert 'RedPaletteColorLookupTableDescriptor' not in ds
+        msg = r"No suitable Palette Color Lookup Table Module found"
+        with pytest.raises(ValueError, match=msg):
+            apply_color_lut(ds.pixel_array, ds)
+
 
 @pytest.mark.skipif(not HAVE_NP, reason="Numpy is not available")
 class TestNumpy_ExpandSegmentedLUT(object):