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

When log.Debug is activated in certain environments, it catches an Exception. #462

Closed
Guluis opened this issue Mar 13, 2022 · 1 comment
Closed
Assignees

Comments

@Guluis
Copy link

Guluis commented Mar 13, 2022

A new method was added to FileLog.cs called Debug(string).
In the past, all calls to log were checked with if(Harmony.DEBUG) but now this new method is called in the FileLog class.
This means that the FileLog static constructor runs when before it didn't.
In environments like dockers on Linux, the constructor runs this code and catches an exception:

var desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
_ = Directory.CreateDirectory(desktopPath);

This code catches an exception in these environments because desktopPath is null

@pardeike
Copy link
Owner

Should be fixed by 8c6a062

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

No branches or pull requests

2 participants