directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1458955 - /directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ProjectsExporter.java
Date Wed, 20 Mar 2013 17:07:36 GMT
Author: pamarcelot
Date: Wed Mar 20 17:07:36 2013
New Revision: 1458955

URL: http://svn.apache.org/r1458955
Log:
Fix for DIRSTUDIO-891 (A schema project containing a reference to a deleted connection makes
the perspective completely unusable).

Modified:
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ProjectsExporter.java

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ProjectsExporter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ProjectsExporter.java?rev=1458955&r1=1458954&r2=1458955&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ProjectsExporter.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ProjectsExporter.java
Wed Mar 20 17:07:36 2013
@@ -22,6 +22,7 @@ package org.apache.directory.studio.sche
 
 import java.util.List;
 
+import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.schemaeditor.model.Project;
 import org.apache.directory.studio.schemaeditor.model.ProjectType;
 import org.apache.directory.studio.schemaeditor.model.Schema;
@@ -128,11 +129,21 @@ public class ProjectsExporter
             // If project is an Online Schema Project
             if ( type.equals( ProjectType.ONLINE ) )
             {
-                // Connection Name
-                element.addAttribute( CONNECTION_TAG, project.getConnection().getId() );
+                // Connection ID
+                Connection connection = project.getConnection();
 
-                // Connection Name
-                element.addAttribute( SCHEMA_CONNECTOR_TAG, project.getSchemaConnector().getId()
);
+                if ( connection != null )
+                {
+                    element.addAttribute( CONNECTION_TAG, connection.getId() );
+                }
+
+                // Schema Connection ID
+                SchemaConnector schemaConnector = project.getSchemaConnector();
+
+                if ( schemaConnector != null )
+                {
+                    element.addAttribute( SCHEMA_CONNECTOR_TAG, project.getSchemaConnector().getId()
);
+                }
 
                 // Schema Backup
                 Element schemaBackupElement = element.addElement( SCHEMA_BACKUP_TAG );



Mime
View raw message