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

Fixed bug when jemoji is included via module-info.java #45

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

Terge3141
Copy link
Contributor

Dear felldo,
first of all, let me say that this is really a great library! It is exactly what I was looking for.
It tried to include JEmoji into my java project where I use module-info.java. However, several functions such as EmojiManager.getAllEmojis() throw an exception (see below). emojitest.tar.gz contains an example project which will reproduce the error .
The reason is that readFileAsString cannot load the ressource-path PATH by means of classLoader.getResourceAsStream(PATH). According to stackeroverflow.com one should use EmojiManager.class.getResourceAsStream(PATH) instead. This is the content of the PR.

It would be great if you could merge my PR.

Best regards,

Michael

Error message:
------------------------------------------snip------------------------------------------
Exception in thread "main" java.lang.ExceptionInInitializerError
at test/test.Program.main(Program.java:11)
Caused by: java.lang.IllegalArgumentException: argument "content" is null
at [email protected]/com.fasterxml.jackson.databind.ObjectMapper._assertNotNull(ObjectMapper.java:5054)
at [email protected]/com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3828)
at net.fellbaum.jemoji/net.fellbaum.jemoji.EmojiManager.(EmojiManager.java:38)
... 1 more
------------------------------------------snap------------------------------------------

@felldo
Copy link
Owner

felldo commented Jan 9, 2024

Hi, thank you for reporting this.
Can you please upload your example to i.e. a git repo / gist / a branch in your forked repository of JEmoji so I can have a look at it?
Opening zip files from an untrusted source can be dangerous due to things like zip bombs.

@Terge3141
Copy link
Contributor Author

@felldo
Copy link
Owner

felldo commented Jan 22, 2024

I have tested this a bit in different scenarios and this seems to be okay. Thanks!

@felldo felldo merged commit af70ebf into felldo:master Jan 22, 2024
1 check passed
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.

2 participants