Greavesy1899 / MafiaToolkit

Open source toolkit for Mafia games. (Mafia II, Mafia III, Mafia DE)
MIT License
123 stars 20 forks source link

Do not crash if Icon.ExtractAssociatedIcon returns null #29

Closed RoadTrain closed 4 years ago

RoadTrain commented 4 years ago

Another fix required to launch toolkit under Wine. At first I thought it was a Wine problem, but it looks like Icon.ExtractAssociatedIcon can actually return null in some situations: https://referencesource.microsoft.com/#System.Drawing/commonui/System/Drawing/Icon.cs,289

So we better check for null here -- the worst case is just missing icons: image

RoadTrain commented 4 years ago

Other than that the toolkit runs fine on Linux! There are some specific wine tweaks needed though. Maybe I could describe them on the wiki or somewhere else.

Greavesy1899 commented 4 years ago

Committed both PRs. Thanks for overlooking Linux support.