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

[BUG] Potential crash when icons cannot be loaded properly #159

Closed
topeterk opened this issue Apr 26, 2021 · 3 comments
Closed

[BUG] Potential crash when icons cannot be loaded properly #159

topeterk opened this issue Apr 26, 2021 · 3 comments
Assignees
Milestone

Comments

@topeterk
Copy link
Collaborator

When icon is null at this point, this line gets executed ...

icon = Properties.Resources.WhiteTransparency;

... and the app it crashes as STM tries to load the resource but that is not existing.

@topeterk
Copy link
Collaborator Author

topeterk commented Apr 26, 2021

I wanted to have a look at the failover when icon loading fails, it seems to work for most folders but with C:\Windows\system32 it crashes at this point with:

Properties.Resources.WhiteTransparency = 'Properties.Resources.WhiteTransparency' threw an exception of type 'System.Reflection.TargetInvocationException'

However, I thought this is the ressource as I cannot find the WhiteTransparency icon but as it works most of the time it might be something different?

I tested this by forcing Shell32SHGetFileInfo to return IntPtr.Zero;.

@topeterk
Copy link
Collaborator Author

It could be related to this as it starts failing at row item 3276 on my system.
Maybe the icon must be loaded into some static variable, so it is access via Properties only once and than just clone this object manually at the mentioned code location?

@Hofknecht
Copy link
Owner

as discussed in chat you are allowed to change
your help is welcome, we looking forward to see your change

thank you @topeterk !!!

@Hofknecht Hofknecht added this to the 1.1 milestone Apr 26, 2021
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

2 participants