Yea it's doable kinda like Krrks said.
Another thing tho: gotta check to see if it's a "real" sun object.
Because NanoFXv2 creates suns inside planets to give a glow effect with its AtmosphereFX feature. But with a bit clever scripting it's easy to check those (mainly because of their names). GC/GravityFX does that.
Also, the Destiny recharges itself by literally "surfing" a star, she doesn't just pass close to it, she doesn't have "solar panels" in the real sense.
And in the ST universe, except for some really small craft (like shuttles, or not even that...), having solar panels to get power from a star, as close as it could be, would most likely still not be enough to even recharge the batteries efficiently (that is, in a good amount of time and so) to be of any use.