Browse Source

Fix bug where error is shown when named view isn't set.

Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
Jason Lewis 12 years ago
parent
commit
a5cc8616fc
1 changed files with 2 additions and 2 deletions
  1. 2 2
      laravel/view.php

+ 2 - 2
laravel/view.php

@@ -118,9 +118,9 @@ class View implements ArrayAccess {
 	 */
 	public static function exists($view, $return_path = false)
 	{
-		if(starts_with($view, 'name: '))
+		if (starts_with($view, 'name: ') and array_key_exists($name = substr($view, 6), static::$names))
 		{
-			$view = static::$names[substr($view, 6)];
+			$view = static::$names[$name];
 		}
 		
 		list($bundle, $view) = Bundle::parse($view);