Fix checking if a variable is defined before adding to cache
Fix checking if a variable is defined before adding to cache

The variable `var` was not being de-referenced to check the existence
of the intended variable.

Change-Id: Ic4b12d0240af431b544d9e2d83be111f66cb24bb

InsightSoftwareConsortium/SimpleITK,blowekamp/SimpleITK,InsightSoftwareConsortium/SimpleITK,richardbeare/SimpleITK,richardbeare/SimpleITK,InsightSoftwareConsortium/SimpleITK,kaspermarstal/SimpleElastix,SimpleITK/SimpleITK,blowekamp/SimpleITK,blowekamp/SimpleITK,SimpleITK/SimpleITK,blowekamp/SimpleITK,kaspermarstal/SimpleElastix,blowekamp/SimpleITK,kaspermarstal/SimpleElastix,kaspermarstal/SimpleElastix,InsightSoftwareConsortium/SimpleITK,richardbeare/SimpleITK,SimpleITK/SimpleITK,kaspermarstal/SimpleElastix,SimpleITK/SimpleITK,richardbeare/SimpleITK,SimpleITK/SimpleITK,richardbeare/SimpleITK,blowekamp/SimpleITK,InsightSoftwareConsortium/SimpleITK,SimpleITK/SimpleITK,kaspermarstal/SimpleElastix,richardbeare/SimpleITK,kaspermarstal/SimpleElastix,richardbeare/SimpleITK,InsightSoftwareConsortium/SimpleITK,richardbeare/SimpleITK,SimpleITK/SimpleITK,blowekamp/SimpleITK,InsightSoftwareConsortium/SimpleITK,SimpleITK/SimpleITK,blowekamp/SimpleITK,InsightSoftwareConsortium/SimpleITK