A wizard did it.
It's science fiction, make up some imaginary way of bendable light or whatever.
I wouldn't even call it immersion breaking it such a non-issue.
Please, FD, put this below the bottom of your list of things to change in the name of realism, exploration is tedious enough without having to loop around stars to scan them.
Given that our scanners work at faster than light speeds (think of what the advanced discovery scanner is capable of!) I have to assume that scanning through a star is relatively trivial. And no, I don't want them to reduce the capabilities of the scanners....