As long as the property was still advertised and available to rent during the period of time it was vacant, then you can still claim expenses for maintaining and preserving the property even though it was vacant.
If it was no longer advertised and available to rent, then it was essentially converted to personal use and those expenses are not deductible.
See the following information from the IRS:
IRS Publication 527 - property vacant while for sale
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"