Trying to assign a sprite, but getting Type missmatch

I am selecting all objects, then I filter out the textures, then I create a sprite, then I assign it.
The problem I am having, is I am getting a “Type missmatch” error.

170963-capture1.png

Code

public void StartBulkChangeIcons()
        {
            if (Selection.objects.Length == 0) return;
            
            Texture2D[] textures = Selection.GetFiltered<Texture2D>(SelectionMode.Unfiltered);
            GameObject[] gameObjects = Selection.GetFiltered<GameObject>(SelectionMode.Unfiltered);
            
            Debug.LogFormat("Total selected Textures: {0}", textures.Length);
            Debug.LogFormat("Total selected GameObjects: {0}", gameObjects.Length);

            for (int i = 0; i < gameObjects.Length; i++)
            {
                Sprite sprite = GetThumbnail(textures, gameObjects*.name);*

if (sprite != null)
{
gameObjects*.GetComponent().Icon = sprite;*
}
}
}

public Sprite GetThumbnail(Texture2D[] textures, string target)
{
Sprite sprite = null;
for (int i = 0; i < textures.Length; i++)
{
if (textures*.name.Replace("thumbnail", “”) == target)*
{
sprite = Sprite.Create(textures, new Rect(0.0f, 0.0f, textures.width, textures*.height), new Vector2(0.5f, 0.5f), 100.0f);_
_sprite.name = textures.name;
return sprite;
}
}
return sprite;
}*_

AssetDatabase.LoadAssetAtPath(AssetDatabase.GetAssetPath(textures*));*