LPS-45853 Prevent ReferenceError if Liferay is working in non-surface mode