mat.GetTexture() ends in an infinite loop - eviltoast

I was doing the (assimp part of this OpenGL tutorial)[https://learnopengl.com/Model-Loading/Model], but in the function loadMaterialTextures, when GetTexture is called, the function ends in an infinite loop and nothing is displayed, why does this happen?