Fix crash issue due to commit 8945348.
Merge pull request #1389 from zhilwang/issue-fix

Fix crash issue due to commit 8945348.