Merge "Add a null check to avoid NPE." into tm-qpr-dev