diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2020-05-31 19:10:27 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2020-05-31 19:10:27 +0200 |
commit | 9c0d21477617f8bbf771c26787ca5e13d4b29a8a (patch) | |
tree | 5ddf572eb2ca5f15084d4e2d5af85954601c46d4 /core/os | |
parent | a8787d1ae56006c00b4eecc3506dbc5ec763a8a5 (diff) |
Print errors when calling MIDI input methods on unsupported platforms
This partially addresses #32065.
Diffstat (limited to 'core/os')
-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())); } } |