Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raise clean exception for no files to minify #1450

Merged
merged 2 commits into from
Sep 19, 2023

Conversation

HolgerJeromin
Copy link
Contributor

@HolgerJeromin HolgerJeromin commented Sep 19, 2023

Better having a exact exception instead of non helpful exception in compress:

Fatal error: Cannot read properties of null (reading 'resolve_defines')
TypeError: Cannot read properties of null (reading 'resolve_defines')
    at Compressor.compress (\node_modules\terser\dist\bundle.min.js:18446:29)
    at minify (\node_modules\terser\dist\bundle.min.js:30387:12)

fixes #1449

lib/minify.js Outdated Show resolved Hide resolved
@fabiosantoscode
Copy link
Collaborator

Added just a tidbit for code consistency, but it looks good. Thanks!

@fabiosantoscode fabiosantoscode merged commit c16b5c6 into terser:master Sep 19, 2023
10 checks passed
@HolgerJeromin
Copy link
Contributor Author

@fabiosantoscode
I took the bracket style from if (Object.keys(files).length > 1) a few lines above :-)

@HolgerJeromin HolgerJeromin deleted the patch-1 branch September 20, 2023 06:51
@fabiosantoscode
Copy link
Collaborator

😮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception when API is called without any file
2 participants