[BZ-1009369] fix incremental compilation when an empty resource is added
(cherry picked from commit 6961ede57a71d0bc10d04ce3cdf511518b8bbbd2)