diff servlet/src/digilib/io/FileOps.java @ 821:6c752969f9e8 stream

more tries and catches...
author robcast
date Tue, 22 Feb 2011 20:08:27 +0100
parents 7357ad8f9f42
children
line wrap: on
line diff
--- a/servlet/src/digilib/io/FileOps.java	Tue Feb 22 18:33:55 2011 +0100
+++ b/servlet/src/digilib/io/FileOps.java	Tue Feb 22 20:08:27 2011 +0100
@@ -107,7 +107,10 @@
 	 * get the mime type for a file format (by extension)
 	 */
 	public static String mimeForFile(File f) {
-		return (String) fileTypes.get(extname(f.getName().toLowerCase()));
+	    if (f == null) {
+	        return null;
+	    }
+		return fileTypes.get(extname(f.getName().toLowerCase()));
 	}
 
 	/**