vanBassum / Wakatime.Unity

A Wakatime plugin for Unity
MIT License
36 stars 7 forks source link

Immediately throws exceptions upon installation/enabling #3

Closed mai-soup closed 1 year ago

mai-soup commented 1 year ago

image

Not sure what other info I can post to help debug this as I only started using Unity a few days ago and am still getting used to it, but the first exception in the image appeared right after adding the package to an existing project, the other happens each time I save the plugin's preferences.

vanBassum commented 1 year ago

Hello, that is weird, I would suspect that I'd run into the same error when testing. I can simply insert a null check there, although I can't test it since I don't get this error myself. If it's ok with you, I can change the code, and you can test this for me?

Update1: I think I already know what's going on, let me get back to you with an update in a bit.

Update2: Exceptions are thrown because of early return in the constructor of WakatimeManager. This triggers the dispose witch tries to dispose objects that are null. I fixed it by adding null checks in the dispose method.

The merge to the main will close this issue. Would you mind testing this fix and let me know if the problem is resolved?

mai-soup commented 1 year ago

Cheers, seems to have fixed it.