I'll keep it in mind, but it gets complicated! Modules and their stats don't exist before the parent module's ship creation, either.
Is this just a refit screen issue, though? If it is then a more targeted fix may be possible, such as just setting the fleet data on whatever faked-up fleet member API the module has.
Edit: and, if it is mainly just a refit screen issue, could it be assumed that it's the player fleet if the current game state is the campaign state?
Edit #2: set it for the refit screen. Note that it'll still sometimes be null (the hullmods get reapplied several times in succession, for reasons, and the first couple of times not all the data is there), so the hullmod code would still need to gracefully handle the case when it's null, but it should work otherwise. For the refit screen only.