Update a test to prevent NPE in test