mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
device: don't crash on Linux if no devices are found
Fixes #634 Closes #635
This commit is contained in:
parent
00b3fbdb1a
commit
bfb50ab7ff
@ -61,6 +61,9 @@ LinuxInputDeviceManager() {
|
|||||||
|
|
||||||
// We'll want to sort the devices by index, since the order may be
|
// We'll want to sort the devices by index, since the order may be
|
||||||
// meaningful (eg. for the Xbox wireless receiver).
|
// meaningful (eg. for the Xbox wireless receiver).
|
||||||
|
if (indices.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
std::sort(indices.begin(), indices.end());
|
std::sort(indices.begin(), indices.end());
|
||||||
_evdev_devices.resize(indices.back() + 1, nullptr);
|
_evdev_devices.resize(indices.back() + 1, nullptr);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user