From 05dce02a240c914e9dba64cc0625a5e308cb16a0 Mon Sep 17 00:00:00 2001
From: Saad Mohammad <smohammad@redhat.com>
Date: Tue, 13 Nov 2012 11:04:38 -0500
Subject: Fix PR1166: Embedded JNLP File is not supported in applet tag

---
 netx/net/sourceforge/jnlp/Parser.java | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

(limited to 'netx/net/sourceforge/jnlp/Parser.java')

diff --git a/netx/net/sourceforge/jnlp/Parser.java b/netx/net/sourceforge/jnlp/Parser.java
index d24c0fd..a825a5b 100644
--- a/netx/net/sourceforge/jnlp/Parser.java
+++ b/netx/net/sourceforge/jnlp/Parser.java
@@ -143,9 +143,16 @@ class Parser {
 
         // JNLP tag information
         this.spec = getVersion(root, "spec", "1.0+");
-        this.codebase = addSlash(getURL(root, "codebase", base));
-        if (this.codebase == null) // We only override it if it is not specified.
+
+        try {
+            this.codebase = addSlash(getURL(root, "codebase", base));
+        } catch (ParseException e) {
+            //If parsing fails, continue by overriding the codebase with the one passed in
+        }
+
+        if (this.codebase == null) // Codebase is overwritten if codebase was not specified in file or if parsing of it failed
             this.codebase = codebase;
+
         this.base = (this.codebase != null) ? this.codebase : base; // if codebase not specified use default codebase
         fileLocation = getURL(root, "href", this.base);
 
-- 
cgit v1.2.3