Skip to content

Commit

Permalink
add condition to handle false value
Browse files Browse the repository at this point in the history
  • Loading branch information
remyperona committed Apr 4, 2024
1 parent 3d1220d commit 137b87d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion classes/Optimization/Process/AbstractProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,12 @@ public function optimize_size( $size, $optimization_level = null ) {
// This file type is not supported.
$extension = $file->get_extension();

if ( '' === $extension ) {
if ( ! $extension ) {
$response = new WP_Error(
'extension_not_mime',
__( 'This file has an extension that does not match a mime type.', 'imagify' )
);
} elseif ( '' === $extension ) {
$response = new WP_Error(
'no_extension',
__( 'With no extension, this file cannot be optimized.', 'imagify' )
Expand Down

0 comments on commit 137b87d

Please sign in to comment.