diff options
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/resource_format_binary.cpp | 2 | ||||
-rw-r--r-- | core/io/resource_saver.cpp | 1 | ||||
-rw-r--r-- | core/io/stream_peer.cpp | 4 |
3 files changed, 4 insertions, 3 deletions
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 861e34e415..38bef2768e 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -712,8 +712,8 @@ Error ResourceInteractiveLoaderBinary::poll() { if (!obj) { error = ERR_FILE_CORRUPT; ERR_EXPLAIN(local_path + ":Resource of unrecognized type in file: " + t); + ERR_FAIL_V(ERR_FILE_CORRUPT); } - ERR_FAIL_COND_V(!obj, ERR_FILE_CORRUPT); Resource *r = Object::cast_to<Resource>(obj); if (!r) { diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index 0cecca904d..e2c1c3402a 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -137,7 +137,6 @@ Error ResourceSaver::save(const String &p_path, const RES &p_resource, uint32_t save_callback(p_resource, p_path); return OK; - } else { } } diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index acf72dbba5..84b8554d54 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -369,7 +369,9 @@ Variant StreamPeer::get_var(bool p_allow_objects) { ERR_FAIL_COND_V(err != OK, Variant()); Variant ret; - decode_variant(ret, var.ptr(), len, NULL, p_allow_objects); + err = decode_variant(ret, var.ptr(), len, NULL, p_allow_objects); + ERR_FAIL_COND_V(err != OK, Variant()); + return ret; } |