Merge "Add a test for the NPE case" into main