The likely cause is that the mirror is locked up, so it is blocking the pentaprism from displaying the image to the viewfinder, on the other hand the sensor is able to have an unobstructed view.
What lenses were you using when this happened?
In that case either mirror lockup is inadvertently set or your camera has a mechanical problem.
Go into the menu an reset all camera settings. See page 56 of your manual.
Wrench (yellow) menu page 4