mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
[Core] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
Error HashingContext::start(HashType p_type) {
|
||||
ERR_FAIL_COND_V(ctx != nullptr, ERR_ALREADY_IN_USE);
|
||||
_create_ctx(p_type);
|
||||
ERR_FAIL_COND_V(ctx == nullptr, ERR_UNAVAILABLE);
|
||||
ERR_FAIL_NULL_V(ctx, ERR_UNAVAILABLE);
|
||||
switch (type) {
|
||||
case HASH_MD5:
|
||||
return ((CryptoCore::MD5Context *)ctx)->start();
|
||||
@@ -48,7 +48,7 @@ Error HashingContext::start(HashType p_type) {
|
||||
}
|
||||
|
||||
Error HashingContext::update(PackedByteArray p_chunk) {
|
||||
ERR_FAIL_COND_V(ctx == nullptr, ERR_UNCONFIGURED);
|
||||
ERR_FAIL_NULL_V(ctx, ERR_UNCONFIGURED);
|
||||
size_t len = p_chunk.size();
|
||||
ERR_FAIL_COND_V(len == 0, FAILED);
|
||||
const uint8_t *r = p_chunk.ptr();
|
||||
@@ -64,7 +64,7 @@ Error HashingContext::update(PackedByteArray p_chunk) {
|
||||
}
|
||||
|
||||
PackedByteArray HashingContext::finish() {
|
||||
ERR_FAIL_COND_V(ctx == nullptr, PackedByteArray());
|
||||
ERR_FAIL_NULL_V(ctx, PackedByteArray());
|
||||
PackedByteArray out;
|
||||
Error err = FAILED;
|
||||
switch (type) {
|
||||
|
||||
Reference in New Issue
Block a user