Perform validation before attempting to save the model.