Prevent setting null as file of media