Prevent crash as described in issue #3743.