From: <bra...@us...> - 2008-08-05 01:28:37
|
Revision: 2524 http://archive-access.svn.sourceforge.net/archive-access/?rev=2524&view=rev Author: bradtofel Date: 2008-08-05 01:28:47 +0000 (Tue, 05 Aug 2008) Log Message: ----------- BUGFIX (ACC-28): check that guessed charset is supported before attempting to use. Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/TextDocument.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/TextDocument.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/TextDocument.java 2008-08-01 17:17:44 UTC (rev 2523) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/TextDocument.java 2008-08-05 01:28:47 UTC (rev 2524) @@ -91,6 +91,9 @@ private boolean isCharsetSupported(String charsetName) { // can you believe that this throws a runtime? Just asking if it's // supported!!?! They coulda just said "no"... + if(charsetName == null) { + return false; + } try { return Charset.isSupported(charsetName); } catch(IllegalCharsetNameException e) { @@ -192,8 +195,10 @@ // (5) detector.reset(); - - return charsetName; + if(isCharsetSupported(charsetName)) { + return charsetName; + } + return null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |