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

compress-vpk: unhandled exception when compressing a text file #1

Open
city41 opened this issue Dec 25, 2024 · 0 comments
Open

compress-vpk: unhandled exception when compressing a text file #1

city41 opened this issue Dec 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@city41
Copy link
Owner

city41 commented Dec 25, 2024

echo "a b c" > foo.txt
compress-vpk foo.txt foo.vpk
TypeError: Cannot read properties of undefined (reading 'node')
    at write_huffman_tree (/home/matt/dotfiles/config/.config/yarn/global/node_modules/@city41/ereader-tools/dist/lib/compress.js:141:14)
    at create_huffman_tree (/home/matt/dotfiles/config/.config/yarn/global/node_modules/@city41/ereader-tools/dist/lib/compress.js:339:5)
    at compress (/home/matt/dotfiles/config/.config/yarn/global/node_modules/@city41/ereader-tools/dist/lib/compress.js:520:20)
    at main (/home/matt/dotfiles/config/.config/yarn/global/node_modules/@city41/ereader-tools/dist/cli/compress-vpk.js:48:29)

Which is fine, nevpk seg faults when trying to compress text. Compressing text is not the point of this tool.

Detect the input file is text, and emit a proper error instead of proceeding.

@city41 city41 added the enhancement New feature or request label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant