autotests: Fix crash

If a test case is skipped, there will be no input devices.
This commit is contained in:
Vlad Zahorodnii 2023-04-15 23:50:33 +03:00
parent 7a1a1161cc
commit 15f6c910be

View file

@ -115,9 +115,15 @@ void WaylandTestApplication::createVirtualInputDevices()
void WaylandTestApplication::destroyVirtualInputDevices()
{
input()->removeInputDevice(m_virtualPointer.get());
input()->removeInputDevice(m_virtualTouch.get());
input()->removeInputDevice(m_virtualKeyboard.get());
if (m_virtualPointer) {
input()->removeInputDevice(m_virtualPointer.get());
}
if (m_virtualTouch) {
input()->removeInputDevice(m_virtualTouch.get());
}
if (m_virtualKeyboard) {
input()->removeInputDevice(m_virtualKeyboard.get());
}
}
void WaylandTestApplication::performStartup()