diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-06-03 11:09:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-03 11:09:10 +0200 |
commit | 9043605ab8160ff32528c44d10b058ab8200be2a (patch) | |
tree | aa400738cdf37d16b38365c009de51e98a80b92b /core | |
parent | cec49bd194bf42d04bb5b35b0e807fea15b896a0 (diff) | |
parent | 9c0d21477617f8bbf771c26787ca5e13d4b29a8a (diff) |
Merge pull request #39201 from Calinou/midi-input-unsupported-error
Print errors when calling MIDI input methods on unsupported platforms
Diffstat (limited to 'core')
-rw-r--r-- | core/os/os.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index c29930e485..56755bcf51 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -457,18 +457,22 @@ PackedStringArray OS::get_connected_midi_inputs() { } PackedStringArray list; - return list; + ERR_FAIL_V_MSG(list, vformat("MIDI input isn't supported on %s.", OS::get_singleton()->get_name())); } void OS::open_midi_inputs() { if (MIDIDriver::get_singleton()) { MIDIDriver::get_singleton()->open(); + } else { + ERR_PRINT(vformat("MIDI input isn't supported on %s.", OS::get_singleton()->get_name())); } } void OS::close_midi_inputs() { if (MIDIDriver::get_singleton()) { MIDIDriver::get_singleton()->close(); + } else { + ERR_PRINT(vformat("MIDI input isn't supported on %s.", OS::get_singleton()->get_name())); } } |