Skip to content

Commit

Permalink
Stellar - remove .js and set empty type to prevent fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseeproductions committed Apr 17, 2024
1 parent a80e7bc commit f3b24d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Assets/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -1309,9 +1309,12 @@ public function is_compiled(): bool {
* @return static
*/
public function set_as_compiled() {
$file = $this->get_root_path() . $this->get_path() . $this->get_file() . '.asset.php';
$file = $this->get_root_path() . $this->get_path() . str_replace( '.js', '', $this->get_file() ) . '.asset.php';

if ( ! file_exists( $file ) ) {
// Set file type to empty string to prevent fatal error.
$this->set_type( '' );

return $this;
}

Expand Down

0 comments on commit f3b24d7

Please sign in to comment.