title: First read-in prefab name from a text file getting instantiated to null
body: <p>I have a <code>txt</code> file called <strong>prefabs</strong> that contains the names of my prefabs:</p>
  
  <pre><code>prefab1
  </code></pre>
  
  <p>This prefab exists and it works!</p>
  
  <p>Using the following code, I read in the file's content (my prefabs' names):</p>
  
  <pre><code>TextAsset foldersdata = (TextAsset)Resources.Load( "prefabs", typeof(TextAsset) );
  prefabs = foldersdata.text.Split('\n');
  </code></pre>
  
  <p>I display those names in the editor and then whichever name is selected, my Unity program loads that selected prefab:</p>
  
  <pre><code>GUILayout.BeginArea( new Rect( Screen.width/6, Screen.height/6, Screen.width*2/3, Screen.height*2/3 ), displayStyle3 );
  GUILayout.Label("Choose Prefab");
  selectedPrefab = GUILayout.SelectionGrid( selectedPrefab, prefabs, 1, displayStyle2 );
  GUILayout.Label("");
  
  if( GUILayout.Button("Load Prefab") )
  {
    prefab = prefabs[ selectedPrefab ];
    sceneBase = Instantiate( Resources.Load&lt;GameObject&gt;( "Prefabs/" + prefab ) ) as GameObject;
    blah blah blah;
  }
  </code></pre>
  
  <p>So far, I have only had <strong>1</strong> prefab and this has been working flawlessly.</p>
  
  <p>I have now added, at the top of the txt file, a new prefab:</p>
  
  <pre><code>prefab2
  prefab1
  </code></pre>
  
  <p>The txt file is being read and displayed correctly in the editor.</p>
  
  <p>At first, I got this well-known error msg about <strong>prefab2</strong>:</p>
  
  <pre><code>argumentexception: the thing you want to instantiate is null.
  </code></pre>
  
  <p>But because <strong>both</strong> prefabs exist and everything seems fine, I thought this error message probably doesn't apply to this situation literally!</p>
  
  <p>So, I reversed the order in which the prefabs' names appear in the txt file:</p>
  
  <pre><code>prefab1
  prefab2
  </code></pre>
  
  <p>Now, I get this error message for <strong>prefab1</strong> which is the first name.</p>
  
  <p>I kept testing this and I realised that whatever prefab happens to be the first one in the txt file, the editor complains that it is null.</p>
  
  <p>I am really confused now. Could anyone see what the problem is here?</p>