summaryrefslogtreecommitdiff
path: root/core/bind
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-07-01 14:32:04 +0200
committerGitHub <noreply@github.com>2019-07-01 14:32:04 +0200
commitb0ce9401ffa731cc346ab6762fd0794709634428 (patch)
treec2e6de01b9efec28c959dbfd5cd59a0973d432e7 /core/bind
parent531c92a53e5e7b9a1cb55249ef6086e874239872 (diff)
parent3c154eb93b3a098354bf6d18a9428826ec193f90 (diff)
Merge pull request #30126 from qarmin/remove_unnecessary_code
Remove unnecessary code and add some error explanations
Diffstat (limited to 'core/bind')
-rw-r--r--core/bind/core_bind.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index da7b15da94..f9fb7d7695 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -149,8 +149,10 @@ _ResourceLoader::_ResourceLoader() {
}
Error _ResourceSaver::save(const String &p_path, const RES &p_resource, SaverFlags p_flags) {
-
- ERR_FAIL_COND_V(p_resource.is_null(), ERR_INVALID_PARAMETER);
+ if (p_resource.is_null()) {
+ ERR_EXPLAIN("Can't save empty resource to path: " + String(p_path))
+ ERR_FAIL_V(ERR_INVALID_PARAMETER);
+ }
return ResourceSaver::save(p_path, p_resource, p_flags);
}
@@ -246,11 +248,11 @@ PoolStringArray _OS::get_connected_midi_inputs() {
}
void _OS::open_midi_inputs() {
- return OS::get_singleton()->open_midi_inputs();
+ OS::get_singleton()->open_midi_inputs();
}
void _OS::close_midi_inputs() {
- return OS::get_singleton()->close_midi_inputs();
+ OS::get_singleton()->close_midi_inputs();
}
void _OS::set_video_mode(const Size2 &p_size, bool p_fullscreen, bool p_resizeable, int p_screen) {
@@ -2266,7 +2268,7 @@ bool _Directory::current_is_dir() const {
void _Directory::list_dir_end() {
ERR_FAIL_COND(!d);
- return d->list_dir_end();
+ d->list_dir_end();
}
int _Directory::get_drive_count() {