3 new apache icons; thanks to Anderson Forteleza
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / view / bookmark / BookmarkContentProvider.java
index 79d70bf..680a382 100644 (file)
@@ -4,6 +4,7 @@ import java.sql.SQLException;
 
 import com.quantum.model.NotConnectedException;
 import com.quantum.ui.dialog.ExceptionDisplayDialog;
+import com.quantum.ui.dialog.SQLExceptionDialog;
 
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.Viewer;
@@ -20,14 +21,14 @@ public class BookmarkContentProvider implements ITreeContentProvider {
        
     
        public Object[] getChildren(Object element) {
-               if (element instanceof TreeNode) {
+               if (element != null && element instanceof TreeNode) {
                        TreeNode node = (TreeNode) element;
                        try {
                                return node.getChildren();
                        } catch (NotConnectedException e) {
                                ExceptionDisplayDialog.openError(getShell(), null, null, e);
                        } catch (SQLException e) {
-                               ExceptionDisplayDialog.openError(getShell(), null, null, e);
+                               SQLExceptionDialog.openException(getShell(), node.getBookmark(), e);
                        }
                }
                return BookmarkListNode.EMPTY_ARRAY;