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

Fix a nullreference in QRCodeGenerator #121

Merged
merged 3 commits into from Apr 15, 2020

Conversation

robinvanpoppel
Copy link
Collaborator

Removed a bit too many methods in the QRCodeGenerator that were invoked via reflection. Added a test to reproduce and then worked towards a fix. Fixes #119

@robinvanpoppel robinvanpoppel changed the title Fix a nullreference in Fix a nullreference in QRCodeGenerator Apr 15, 2020
@@ -569,6 +569,47 @@ private static bool IsBlocked(Rectangle r1, List<Rectangle> blockedModules)

private static class MaskPattern
{
// NOTE: Methods are invoked via reflection (typeof(MaskPattern).GetMethods()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't do much with the qr code stuff. Do you know why they're using reflection for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately not. The files were copied over from a nuget package (https://github.com/codebude/QRCoder) when the QR Dialog was added. When cleaning up I did not notice that reflection was used. The irony is that in the meantime that package moved away from reflection as well (https://github.com/codebude/QRCoder/blob/master/QRCoder/QRCodeGenerator.cs), so I could update and clean up as well.

I'm struggling a bit with how to handle dependencies in the plgx scenario. I'd rather add a reference to the package but I've not found a way to get this working.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a next step we could grab the latest version of the files from the QRCode repository. Will add that as an item on the board.

@robinvanpoppel robinvanpoppel merged commit a983d9e into master Apr 15, 2020
@robinvanpoppel robinvanpoppel deleted the fix-119-qr-nullreference branch April 15, 2020 19:56
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.

Show-QR error on new version 0.104.0
2 participants