CAMEL-6576: Fix a potential NPE