Either the codes are not broken in time or FDR simply decides that committing the carriers at that stage is too risky, and the US Fleet is not east of Midway when Yamamoto arrives.
Frustrated at the lack of US carriers, the Japanese launch their assault against the island, which fails. They recover their landing force, supplement it with regular sailors, do a little shore bombardment with their cruisers, then try again and once again fail.
At this point, they're forced to go home, and have just burned through a whole lot of precious fuel for nothing.
What happens next, in the short term? Guadalcanal on steroids ?