Fix undefined variable

88399f3 introduced an undefined variable, this fixes that.
Merge pull request #6723 from terminalmage/issue6656

Fix undefined variable