Fix null ref ptr static analysis