Browse Source

Editor: Moved try/catch to inside the condition. Clean up.

Mr.doob 12 years ago
parent
commit
c27707c36f
1 changed files with 12 additions and 12 deletions
  1. 12 12
      editor/js/Loader.js

+ 12 - 12
editor/js/Loader.js

@@ -40,23 +40,23 @@ var Loader = function ( signals ) {
 
 	} );
 
-	this.loadLocalStorage = function() {
+	this.loadLocalStorage = function () {
+
+		if ( localStorage.threejsEditor !== undefined ) {
+
+			try {
 
-		try {
-	
-			if ( localStorage.threejsEditor !== undefined ) {
-	
 				var loader = new THREE.ObjectLoader();
 				var scene = loader.parse( JSON.parse( localStorage.threejsEditor ) );
-	
+
 				signals.sceneAdded.dispatch( scene );
-	
+
+			} catch ( e ) {
+
+				console.warn( "Unable to load object from localStorage." );
+
 			}
-			
-		} catch ( e ) {
-			
-			console.warn( "Unable to load object from localStorage." );
-			
+
 		}
 
 	};