Wiring a light fixture when no previous light fixture exists
Typically when you see white and black connected together it is for a switch loop.

Power comes into the light fixture, then another cable runs to the switch. The cable going to/from the switch will use one wire for hot, and one for switched hot.  There is no neutral at the switch.

The proper thing to do is to mark the end of the white wire with black marker or electrical tape so future people (you) know what it is used for.

Without being there and knowing the quality of the work done before I cant say for sure this is the case, but its very typical.