Material not recognized in WIP 7.0.19189

I tried trimming my mesh in WIP 7 and found the texture material was not recognized.
The Material tab shows the same information in both Rhino 6 and WIP 7:


but the Python script which checks for this material in Rhino 6:

and reports:

Found 499,866 textures with source_mat = 1

fails in WIP 7 reporting:

No textures found source_mat = -1

Should I be using a different test in WIP 7?

Regards,
Terry.

Problem overcome.
Apparently a Rhino 6 .3dm read into a Rhino 7 WIP session will lose the material assignment for a mesh. I re-applied the material to the mesh object and now the texture is displayed and recognized by the script.