NuggoDEV / NuggoDEV/CountersPlus
Game crash on faulty Custom Counter
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 152
- Forks
- 35
- PR merge metrics
- No merged PRs in 30d
Description
It's up to debate whether this is an issue with the mod or not.
Anyway, when the "CounterLocation", "Resource", or "Host" paths contain a typo in the manifest.json of a custom counter, then Counters+ will crash. To me the error messages are a bit vague (see below). Possibly adding the custom counter in a try-catch or checking if the path is correct can give a much more informative log message and then the custom counter can be ignored.
I made a small change in one of my counters while working on another counter, and I thought I somehow caused an incompatibility conflict or something like that. In the end I forgot that I changed the namespace of my counter and didn't update it in the manifest file. So I spent a lot of time looking for a fix in the wrong counter.
Of course it's my fault for making the mistake. I can't deny that. But imho I think Counters+ should be able to handle those exceptions 😅
Example of the first 3 error messages:
[CRITICAL @ 15:20:30 | UnityEngine] NullReferenceException: Object reference not set to an instance of an object
[CRITICAL @ 15:20:30 | UnityEngine] CountersPlus.Installers.CountersInstaller.AddCustomCounter (CountersPlus.Custom.CustomCounter customCounter, System.Type counterType) (at :0)
[CRITICAL @ 15:20:30 | UnityEngine] CountersPlus.Installers.CountersInstaller.InstallBindings () (at :0)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at CountersPlus.Installers.CountersInstaller.InstallBindings and AddCustomCounter, using the manifest.json fields CounterLocation, Resource, and Host described in the report. Reproduce a custom counter with an invalid path, then inspect how the counter is installed and how errors are logged. Done means malformed custom counters are skipped without crashing and the log identifies the invalid path clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100