Fix uninitialized var error. Fixes #8667.
Merge pull request #8783 from s0undt3ch/issues/8667-uninitialized-var

Fix uninitialized var error. Fixes #8667.