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

Process Hangs if cover is not a string #62

Open
juancarlosfarah opened this issue Apr 18, 2018 · 1 comment
Open

Process Hangs if cover is not a string #62

juancarlosfarah opened this issue Apr 18, 2018 · 1 comment

Comments

@juancarlosfarah
Copy link

juancarlosfarah commented Apr 18, 2018

Summary

If you pass something that is not a string as a cover option, the epub generation process will hang on the "Making Cover..." step.

Steps to Reproduce

  • Pass an empty object {} as options.cover.

Expected Behaviour

Process returns an error saying that options.cover must be a string.

Actual Behaviour

Process hangs.

Proposed Solution

Check the type of the cover option.

if (!(cover instanceof String) && (typeof cover !== 'string')) {
   // handle error
}
@gonejack
Copy link

gonejack commented Mar 9, 2019

If we couldn't write enough code to handle invalid input, we should let it crashes to help people understand their problems then take their fixes quickly, it should crashes instead of hanging in my opinion.

Daylon pushed a commit to Daylon/epub-gen that referenced this issue Sep 29, 2024
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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

No branches or pull requests

2 participants