ceiling fan installation with two white wires
You're likely seeing what's called a "switch loop". So the white wire of the cable running between the switch and the light, is used as the switched hot.  The wire should be reidentified as such, but it's often not.

If you're connecting the new light exactly as the old light was, you're probably okay. Use a voltmeter or multimeter to confirm, or have a look in the switch box.