Skip to content

Instantly share code, notes, and snippets.

@headius
Created December 2, 2014 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/2dd9f99ee30d2d7a8470 to your computer and use it in GitHub Desktop.
Save headius/2dd9f99ee30d2d7a8470 to your computer and use it in GitHub Desktop.
diff --git a/core/src/main/java/org/jruby/util/JarResource.java b/core/src/main/java/org/jruby/util/JarResource.java
index a4d5dfa..98ef0d3 100644
--- a/core/src/main/java/org/jruby/util/JarResource.java
+++ b/core/src/main/java/org/jruby/util/JarResource.java
@@ -24,6 +24,9 @@ abstract class JarResource implements FileResource {
// since pathname is actually an uri we need to decode any url decoded characters like %20
// which happens when directory names contain spaces
sanitized = URLDecoder.decode(sanitized, "UTF-8");
+ } catch (IllegalArgumentException iae) {
+ // not actually a URL, for whatever reason
+ return null;
} catch (UnsupportedEncodingException e) {
throw new RuntimeException( "hmm - system does not know UTF-8 string encoding :(" );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment