Make sure the currentStyle property exists before attempting to access it.