Render height fix
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4bb997933..e14a3690c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Changed
 
 - Change SVG export to create a simpler SVG
+- Fix render_lines crash when render height was negative https://github.com/Textualize/rich/pull/2246
 
 ## [12.3.0] - 2022-04-26
 
diff --git a/rich/console.py b/rich/console.py
index 82fc6084d..2f685c875 100644
--- a/rich/console.py
+++ b/rich/console.py
@@ -1327,6 +1327,11 @@ def render_lines(
             _rendered = self.render(renderable, render_options)
             if style:
                 _rendered = Segment.apply_style(_rendered, style)
+
+            render_height = render_options.height
+            if render_height is not None:
+                render_height = max(0, render_height)
+
             lines = list(
                 islice(
                     Segment.split_and_crop_lines(
@@ -1336,7 +1341,7 @@ def render_lines(
                         pad=pad,
                     ),
                     None,
-                    render_options.height,
+                    render_height,
                 )
             )
             if render_options.height is not None:
diff --git a/tests/test_console.py b/tests/test_console.py
index 42d07d0ea..aa92cc420 100644
--- a/tests/test_console.py
+++ b/tests/test_console.py
@@ -20,6 +20,7 @@
 )
 from rich.control import Control
 from rich.measure import measure_renderables
+from rich.padding import Padding
 from rich.pager import SystemPager
 from rich.panel import Panel
 from rich.region import Region
@@ -862,3 +863,18 @@ def __rich_console__(self, console, options):
     expected = "╭──────────────────╮\n│ ╭──────────────╮ │\n│ │ foo          │ │\n│ ╰──────────────╯ │\n│ ╭──────────────╮ │\n│ │ bar          │ │\n│ ╰──────────────╯ │\n│                  │\n│                  │\n│                  │\n│                  │\n╰──────────────────╯\n"
 
     assert result == expected
+
+
+def test_render_lines_height_minus_vertical_pad_is_negative():
+    # https://github.com/Textualize/textual/issues/389
+    console = Console(
+        force_terminal=True,
+        color_system="truecolor",
+        width=20,
+        height=40,
+        legacy_windows=False,
+    )
+    options = console.options.update_height(1)
+
+    # Ensuring that no exception is raised...
+    console.render_lines(Padding("hello", pad=(1, 0)), options=options)

## Type of changes

- [x] Bug fix
- [ ] New feature
- [ ] Documentation / docstrings
- [ ] Tests
- [ ] Other

## Checklist

- [x] I've run the latest [black](https://github.com/psf/black) with default args on new code.
- [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
- [x] I've added tests for new code.
- [x] I accept that @willmcgugan may be pedantic in the code review.

## Description

Fixes the following example:

```python
    from rich.console import Console
    from rich.padding import Padding

    console = Console()
    options = console.options.update_height(1)

    padding = Padding("hello", pad=(1, 1, 1, 1))
    console.render_lines(padding, options=options)
```

The height is ending up negative when specified as 1, because we subtract the vertical padding from it (1-2 = -1). It gets passed to `itertools.islice` in `render_lines` as the "stop" argument, and that bombs out.