Merge "Handle nullptr if memory allocation fails" into sc-dev