How to reproduce:
1. Create a new project
2. In the Scene view hold the right mouse button
3. Move the mouse cursor as far left as it would go and let go of the mouse button
Expected result: the mouse cursor loops to the other side of the screen
Actual result: A "NullReferenceException: Object reference not set to an instance of an object" error is thrown in the Console
Reproducible with: 2022.2.2f1, 2022.2.0a13, 2023.1.0a22
Not reproducible with: 2020.3.43f1, 2021.3.16f1, 2022.2.0a12
Reproducible on: Ubuntu 22.04
Not reproducible on: Windows 10