Issue #2262703 by PawelR: Call to a member function isVisible() on a non-object.

Signed-off-by: Jonathan Hedstrom <jhedstrom@gmail.com>