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

Fix crash issue due to commit 8945348.
Merge remote-tracking branch 'upstream/master' into travis.osx