Prevent error when entity cache module is disabled.

#3693