Redmine 6327 - Interpret failing function calls in ifvarclass as class not set

This is a back port of a07d3b2362de3de1c5f8a43d29c3bcea87b96a3f to 3.6.x.
Good point. Will fix that in the test that's already in master first, and then pick that change to 3.6.x as well.