Fix crash when checking if texture is a button