mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
Fix InputEvent crash when opening project
This commit is contained in:
parent
ff9fb0abea
commit
abb9c0f171
@ -515,9 +515,9 @@ void ProjectSettings::_convert_to_last_version(int p_from_version) {
|
|||||||
Dictionary action = E.value.variant;
|
Dictionary action = E.value.variant;
|
||||||
Array events = action["events"];
|
Array events = action["events"];
|
||||||
for (int i = 0; i < events.size(); i++) {
|
for (int i = 0; i < events.size(); i++) {
|
||||||
Ref<InputEvent> x = events[i];
|
Ref<InputEvent> ev = events[i];
|
||||||
if (x->get_device() == -1) { // -1 was the previous value (GH-97707).
|
if (ev.is_valid() && ev->get_device() == -1) { // -1 was the previous value (GH-97707).
|
||||||
x->set_device(InputEvent::DEVICE_ID_ALL_DEVICES);
|
ev->set_device(InputEvent::DEVICE_ID_ALL_DEVICES);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user