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

Crop button triggers Null Reference Exception #1758

Open
alessandro-antonelli opened this issue Dec 5, 2023 · 5 comments
Open

Crop button triggers Null Reference Exception #1758

alessandro-antonelli opened this issue Dec 5, 2023 · 5 comments

Comments

@alessandro-antonelli
Copy link

System information:

Version: ImageGlass v9.0.8.1208
Release code: kobe
OS: Microsoft Windows NT 10.0.19045.0 64-bit

To Reproduce

Steps to reproduce the behavior:

  1. Open an image with ImageGlass
  2. Press "c" or click on the crop button in the toolbar

Expected behavior:

The crop commands are displayed.

Actual behavior:

The following error message is shown:

Error:

Object reference not set to an instance of an object.
----------------------------------------------------

System.NullReferenceException: Object reference not set to an instance of an object.
   at ImageGlass.FrmCrop.OnUpdateHeight(Boolean performUpdate) in D:\_GITHUB\@d2phap\ImageGlass\Source\ImageGlass\Tools\FrmCrop.cs:line 142
   at ImageGlass.FrmCrop.OnDpiChanged(DpiChangedEventArgs e) in D:\_GITHUB\@d2phap\ImageGlass\Source\ImageGlass\Tools\FrmCrop.cs:line 93
   at System.Windows.Forms.Form.WmDpiChanged(Message& m)
   at ImageGlass.UI.ModernForm.WndProc(Message& m) in D:\_GITHUB\@d2phap\ImageGlass\Source\Components\ImageGlass.UI\Forms\ModernForm.cs:line 200
   at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)

If you click on the button "Continue" each time, the error is displayed again a second time, a third time, a fourth time, a fifth time. Then one last click on "continue" finally causes the crop commands to be displayed as desired.

Screenshots:

image

Additional context:

Already tried to use "Repair install" in control panel, but it did not solve the issue.

@d2phap
Copy link
Owner

d2phap commented Dec 14, 2023

Hi @alessandro-antonelli
Can you please send a video? I cannot reproduce this issue.

@sdsy888
Copy link

sdsy888 commented Jan 19, 2024

Hi @alessandro-antonelli Can you please send a video? I cannot reproduce this issue.

Hi @d2phap , please check the video below

2024-01-19.11-57-29.1.mp4

d2phap added a commit that referenced this issue Jan 30, 2024
d2phap added a commit that referenced this issue Jan 30, 2024
@d2phap d2phap added this to the v9.0.10 milestone Jan 30, 2024
@d2phap
Copy link
Owner

d2phap commented Jan 31, 2024

Can you check if it's fixed in ImageGlass 9.0.10.201

@alessandro-antonelli
Copy link
Author

Still not fixed, but the stack trace in the error message has changed.

Error message before updating:

Version: ImageGlass v9.0.9.1230
Release code: kobe
OS: Microsoft Windows NT 10.0.19045.0 64-bit


Error:

Object reference not set to an instance of an object.

System.NullReferenceException: Object reference not set to an instance of an object.
at ImageGlass.FrmCrop.OnUpdateHeight(Boolean performUpdate) in D:_GITHUB@d2phap\ImageGlass\Source\ImageGlass\Tools\FrmCrop.cs:line 142
at ImageGlass.FrmCrop.OnDpiChanged(DpiChangedEventArgs e) in D:_GITHUB@d2phap\ImageGlass\Source\ImageGlass\Tools\FrmCrop.cs:line 93
at System.Windows.Forms.Form.WmDpiChanged(Message& m)
at ImageGlass.UI.ModernForm.WndProc(Message& m) in D:_GITHUB@d2phap\ImageGlass\Source\Components\ImageGlass.UI\Forms\ModernForm.cs:line 200
at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)

Error message after updating:

Version: ImageGlass v9.0.10.201
Release code: kobe
Magick.NET: Magick.NET Q16-HDRI-OpenMP x64 netstandard21 13.5.0
WebView2 Runtime: 120.0.2210.144
OS: Microsoft Windows NT 10.0.19045.0 64-bit


Error:

Object reference not set to an instance of an object.

System.NullReferenceException: Object reference not set to an instance of an object.
at ImageGlass.FrmCrop.ApplyTheme(Boolean darkMode, Nullable`1 style) in D:_GITHUB@d2phap\ImageGlass\Source\ImageGlass\Tools\FrmCrop.cs:line 65
at ImageGlass.FrmCrop.OnDpiChanged(DpiChangedEventArgs e) in D:_GITHUB@d2phap\ImageGlass\Source\ImageGlass\Tools\FrmCrop.cs:line 95
at System.Windows.Forms.Form.WmDpiChanged(Message& m)
at ImageGlass.UI.ModernForm.WndProc(Message& m) in D:_GITHUB@d2phap\ImageGlass\Source\Components\ImageGlass.UI\Forms\ModernForm.cs:line 200
at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)

@d2phap
Copy link
Owner

d2phap commented Jan 31, 2024

Thanks @alessandro-antonelli for the info, I will try to check again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants