Author: jalkanen
Date: Thu Mar 13 13:53:25 2008
New Revision: 636885
URL: http://svn.apache.org/viewvc?rev=636885&view=rev
Log:
Now checks if the oldPage exists before trying to rename it. Fixes an issue
with the Main page sometimes getting destroyed.
Modified:
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/PageRenamer.java
Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/PageRenamer.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/PageRenamer.java?rev=636885&r1=636884&r2=636885&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/PageRenamer.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/PageRenamer.java Thu Mar 13
13:53:25 2008
@@ -120,6 +120,12 @@
throw new WikiException( "Page exists" );
}
+ if( !m_wikiEngine.pageExists( oldName ) )
+ {
+ log.debug("Attempt to rename a page which does not exist anymore :
"+newName );
+ throw new WikiException( "Page does not exist anymore" );
+ }
+
// Tell the providers to actually move the data around...
movePageData( oldName, newName );
moveAttachmentData( oldName, newName );