PySport/kloppy

UnboundLocalError: local variable 'player' referenced before assignment (skillcorner.py in tracking)

tmgf-lab opened this issue · 1 comments

The error appears when I load local files and I do not use limit argument.

I've resolved the UnboundLocalError by initializing the player variable on line 96 and adding a condition on line 156 to ensure the variable is not empty before using it. While this prevents the error, I'm not sure if this fully addresses the root cause or if there are other edge cases or logic considerations I'm missing. I'd appreciate it if someone could review the fix and confirm if this is the correct approach or if there's a deeper issue that needs to be addressed.

Thank you!

@tmgf-lab Any chance you could either create a Pull Request or add more details on what file, what version, and what changes you actually made, or create a minimal working example? It's impossible to know what you've done and what the error is without more info.