Prevent fatal error when filtering tables in the navigation tree. (bug #4159)