It appears that in some cases, the index is not updated when a diagram is removed.
These steps probably can't be re-created reliably, but the solution should be fairly obvious.
1) Go to our sandbox on the wiki: http://wiki.gliffy.com/display/sand/Home
2) Delete any diagram
3) Create/edit another diagram
4) File->Open
5) The exception below is thrown if the attachment index entry was not removed. By re-indexing, I was able to fix this problem.
The fix should be pretty easy. Before we do anything with the 'current' object, we should check to make sure it is not null. If it is null, we should not add the attachment to the list. We probably want to log this condition with WARN, including the name of the attachment that could not be added.
Exception stack trace:
@4000000047d7239612d480d4 2008-03-11 19:27:56,310 ERROR [resin-tcp-connection-j2ee.wiki.gliffy.com:6802-35] [core.action.client.ClientDiagramListAction] logThrowable Throwable caught...
@4000000047d7239612d49074 Thrown object:java.lang.NullPointerException
@4000000047d7239612d4945c Short Description:java.lang.NullPointerException
@4000000047d7239612d49844 Message:null
@4000000047d7239612d49c2c Stack trace:
@4000000047d7239612d4a014 com.gliffy.confluencePlugin.dao.ConfluenceDiagramDAO.getDiagramsByUserCredentials(ConfluenceDiagramDAO.java:120)
@4000000047d7239612d53484 com.gliffy.confluencePlugin.auth.ConfluenceAuthMgr.getEditibleDiagrams(ConfluenceAuthMgr.java:81)
@4000000047d7239612d53c54 com.gliffy.core.biz.DefaultUserBiz.getDiagramList(DefaultUserBiz.java:52)
@4000000047d7239612d5403c com.gliffy.core.action.client.ClientDiagramListAction.process(ClientDiagramListAction.java:94)
@4000000047d7239612d5480c com.gliffy.core.action.GliffyAction.execute(GliffyAction.java:50)
@4000000047d7239612d5674c org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:445)
@4000000047d7239612d56b34 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:250)