Revision: 3687
Author: [email protected]
Date: Thu Jul  8 07:10:29 2010
Log: Fixed an NPE with cut and paste of tables. The parent pointer of the table had been set to null by the time the paste was done.
http://code.google.com/p/power-architect/source/detail?r=3687

Modified:
 /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java

=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java Mon Jul 5 12:39:21 2010 +++ /trunk/src/main/java/ca/sqlpower/architect/swingui/PlayPen.java Thu Jul 8 07:10:29 2010
@@ -1616,7 +1616,13 @@
setMessage(ArchitectUtils.truncateString(((SQLTable)someData).getName())); preferredLocation.x += tp.getPreferredSize().width + 5;

- String platform = SPObjectUtils.getAncestor(someData, SQLDatabase.class).getDataSource().getParentType().getName(); + SQLDatabase dbAncestor = SPObjectUtils.getAncestor(someData, SQLDatabase.class);
+                        String platform;
+                        if (dbAncestor == null) {
+                            platform = null;
+                        } else {
+ platform = dbAncestor.getDataSource().getParentType().getName();
+                        }
addedColumns.putAll(platform, tp.getModel().getChildren(SQLColumn.class));

                         increaseProgress();

Reply via email to