Revision: 3688
Author: [email protected]
Date: Thu Jul 8 07:10:52 2010
Log: Fixed an NPE with cut and paste of columns. The parent pointer of the
column had been set to null by the time the paste was done.
http://code.google.com/p/power-architect/source/detail?r=3688
Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/TablePane.java
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/TablePane.java Wed
May 26 14:48:19 2010
+++ /trunk/src/main/java/ca/sqlpower/architect/swingui/TablePane.java Thu
Jul 8 07:10:52 2010
@@ -828,7 +828,14 @@
ArrayListMultimap<String, SQLColumn> droppedColumns =
ArrayListMultimap.create();
for (SQLObject o : droppedItems) {
if (o instanceof SQLColumn) {
- droppedColumns.put(((SQLColumn)
o).getParent().getParentDatabase().getDataSource().getParentType().getName(),
(SQLColumn) o);
+ String fromDataSource;
+ SQLTable parent = ((SQLColumn) o).getParent();
+ if (parent != null) {
+ fromDataSource =
parent.getParentDatabase().getDataSource().getParentType().getName();
+ } else {
+ fromDataSource = null;
+ }
+ droppedColumns.put(fromDataSource, (SQLColumn) o);
} else if (o instanceof SQLTable) {
droppedColumns.putAll(((SQLTable)
o).getParentDatabase().getDataSource().getParentType().getName(),
((SQLTable) o).getChildren(SQLColumn.class));
}