CB-10691: Check the context to avoid null errors