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;
        
     
        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;