LPS-42530 Null check on the wrong variable