summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
Diffstat (limited to 'core/io')
-rw-r--r--core/io/packet_peer.cpp5
-rw-r--r--core/io/resource_format_binary.cpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp
index c77c81f9e2..1e4ea715b3 100644
--- a/core/io/packet_peer.cpp
+++ b/core/io/packet_peer.cpp
@@ -110,10 +110,11 @@ Error PacketPeer::put_var(const Variant &p_packet, bool p_full_objects) {
Variant PacketPeer::_bnd_get_var(bool p_allow_objects) {
Variant var;
- get_var(var, p_allow_objects);
+ Error err = get_var(var, p_allow_objects);
+ ERR_FAIL_COND_V(err != OK, Variant());
return var;
-};
+}
Error PacketPeer::_put_packet(const PoolVector<uint8_t> &p_buffer) {
return put_packet_buffer(p_buffer);
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 38bef2768e..146480e5a2 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -718,8 +718,8 @@ Error ResourceInteractiveLoaderBinary::poll() {
Resource *r = Object::cast_to<Resource>(obj);
if (!r) {
error = ERR_FILE_CORRUPT;
- memdelete(obj); //bye
ERR_EXPLAIN(local_path + ":Resource type in resource field not a resource, type is: " + obj->get_class());
+ memdelete(obj); //bye
ERR_FAIL_V(ERR_FILE_CORRUPT);
}