Fixed fatal error when getLocalCopy() fails

bug: 40166
Change-Id: Ibfcddc1a9c05fad4ac0b51a5a046d1ffaeb49db8
(cherry picked from commit 6c5104111cb2545b04f16fcb4a7efe419344b44e)
Merge "Fixed fatal error when getLocalCopy() fails" into REL1_22