roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghu...@apache.org
Subject svn commit: r1552292 - /roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java
Date Thu, 19 Dec 2013 12:29:46 GMT
Author: ghuber
Date: Thu Dec 19 12:29:45 2013
New Revision: 1552292

URL: http://svn.apache.org/r1552292
Log:
check for nulls

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java?rev=1552292&r1=1552291&r2=1552292&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java
Thu Dec 19 12:29:45 2013
@@ -100,7 +100,9 @@ public class MediaFileBase extends UIAct
                 for (int index = 0; index < fileIds.length; index++) {
                     log.debug("Deleting media file - " + fileIds[index]);
                     MediaFile mediaFile = manager.getMediaFile(fileIds[index]);
-                    manager.removeMediaFile(getActionWeblog(), mediaFile);
+                    if (mediaFile != null) {
+                        manager.removeMediaFile(getActionWeblog(), mediaFile);
+                    }
                 }
             }
 
@@ -110,8 +112,10 @@ public class MediaFileBase extends UIAct
                 for (int index = 0; index < dirIds.length; index++) {
                     log.debug("Deleting media file directory - " + dirIds[index]);
                     MediaFileDirectory mediaFileDir = manager.getMediaFileDirectory(dirIds[index]);
-                    mediaFileDir.getParent().removeChildDirectory(mediaFileDir);
-                    manager.removeMediaFileDirectory(mediaFileDir);
+                    if (mediaFileDir != null) {
+                        mediaFileDir.getParent().removeChildDirectory(mediaFileDir);
+                        manager.removeMediaFileDirectory(mediaFileDir);
+                    }
                 }
             }
             WebloggerFactory.getWeblogger().getWeblogManager().saveWeblog(this.getActionWeblog());



Mime
View raw message