verify that the string element type exists

This fixes a SEGV if the detected string element type does not exist