CORE-4753: Added NPE protection