I can't negate what must have been an awful and scarring experience for you - and the truth is such things can happen so you need to cover yourself as much as you can, making sure that anything you share - even with friends - is adequately licensed and so on. Using something like GitLab to host a private repository while you develop also provides a time-line and code trail which would easily counter any claim anyone else made on your work.
But for every bad egg there are lots of good people out there willing to help and encourage simply because they themselves are in a similar position of have gone through it in the past, or just because they are enthusiastic about game development and want to see what you come up with.
One of the great rewards of game development is to see people playing and enjoying the fruits of your work. I suspect that applies to any creative endeavour.