Merge pull request #96292 from AThousandShips/null_check_ref_fix
Cleanup of raw `nullptr` checks with `Ref`
This commit is contained in:
commit
d15de6f264
48 changed files with 169 additions and 170 deletions
|
|
@ -675,7 +675,7 @@ GDExtensionInterfaceFunctionPtr GDExtension::get_interface_function(const String
|
|||
}
|
||||
|
||||
Error GDExtension::open_library(const String &p_path, const Ref<GDExtensionLoader> &p_loader) {
|
||||
ERR_FAIL_NULL_V_MSG(p_loader, FAILED, "Can't open GDExtension without a loader.");
|
||||
ERR_FAIL_COND_V_MSG(p_loader.is_null(), FAILED, "Can't open GDExtension without a loader.");
|
||||
loader = p_loader;
|
||||
|
||||
Error err = loader->open_library(p_path);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
Error FileAccessEncrypted::open_and_parse(Ref<FileAccess> p_base, const Vector<uint8_t> &p_key, Mode p_mode, bool p_with_magic) {
|
||||
ERR_FAIL_COND_V_MSG(file != nullptr, ERR_ALREADY_IN_USE, "Can't open file while another file from path '" + file->get_path_absolute() + "' is open.");
|
||||
ERR_FAIL_COND_V_MSG(file.is_valid(), ERR_ALREADY_IN_USE, "Can't open file while another file from path '" + file->get_path_absolute() + "' is open.");
|
||||
ERR_FAIL_COND_V(p_key.size() != 32, ERR_INVALID_PARAMETER);
|
||||
|
||||
pos = 0;
|
||||
|
|
@ -162,7 +162,7 @@ void FileAccessEncrypted::_close() {
|
|||
}
|
||||
|
||||
bool FileAccessEncrypted::is_open() const {
|
||||
return file != nullptr;
|
||||
return file.is_valid();
|
||||
}
|
||||
|
||||
String FileAccessEncrypted::get_path() const {
|
||||
|
|
|
|||
|
|
@ -4225,7 +4225,7 @@ Dictionary Image::compute_image_metrics(const Ref<Image> p_compared_image, bool
|
|||
result["root_mean_squared"] = INFINITY;
|
||||
result["peak_snr"] = 0.0f;
|
||||
|
||||
ERR_FAIL_NULL_V(p_compared_image, result);
|
||||
ERR_FAIL_COND_V(p_compared_image.is_null(), result);
|
||||
Error err = OK;
|
||||
Ref<Image> compared_image = duplicate(true);
|
||||
if (compared_image->is_compressed()) {
|
||||
|
|
|
|||
|
|
@ -814,7 +814,7 @@ bool PList::load_string(const String &p_string, String &r_err_out) {
|
|||
}
|
||||
|
||||
PackedByteArray PList::save_asn1() const {
|
||||
if (root == nullptr) {
|
||||
if (root.is_null()) {
|
||||
ERR_FAIL_V_MSG(PackedByteArray(), "PList: Invalid PList, no root node.");
|
||||
}
|
||||
size_t size = root->get_asn1_size(1);
|
||||
|
|
@ -848,7 +848,7 @@ PackedByteArray PList::save_asn1() const {
|
|||
}
|
||||
|
||||
String PList::save_text() const {
|
||||
if (root == nullptr) {
|
||||
if (root.is_null()) {
|
||||
ERR_FAIL_V_MSG(String(), "PList: Invalid PList, no root node.");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue