Fix: Ensure imagepaths is always a dictionary #199
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch ensures that the
imagepaths
variable is always a dictionary,preventing potential runtime errors when it is unexpectedly
None
or another type.Problem Description
After you select a PDF, set "1-end" and push the upload button you get an error message:

Server log
The server's log has:
I found if I waited a few seconds and then clicked Firefox's refresh button, then I would see the empty work area:

This patch prevents the error page from appearing. However, there still remains the problem that with the current high watermark, nothing is parsed. Even with this proposed patch, the parsing does not work; the server's log shows:
To overcome the above error, I had to apply patch #194 :
curl -L https://github.com/camelot-dev/excalibur/pull/194.patch | git apply
to get parsing to work... but, I still have to refresh my page to see the images: