]> gitweb.fperrin.net Git - DictionaryPC.git/commitdiff
Fix compilation.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Thu, 16 Apr 2020 22:46:32 +0000 (00:46 +0200)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Thu, 16 Apr 2020 22:46:32 +0000 (00:46 +0200)
Caused by lack of testing of the testing script :)

src/com/hughes/android/dictionary/parser/wiktionary/WholeSectionToHtmlParser.java

index 2c85d85242cc1b25e4dbc54511ba3eba6970637f..2b719db747b3b5f64edf4c8f938d333c9da04073 100644 (file)
@@ -344,14 +344,13 @@ public class WholeSectionToHtmlParser extends AbstractWiktionaryParser {
 
         if (webUrlTemplate != null) {
             final String webUrl = String.format(webUrlTemplate, title);
 
         if (webUrlTemplate != null) {
             final String webUrl = String.format(webUrlTemplate, title);
-            boolean success = true;
+            String asciiWebUrl = null;
             // URI.create can raise an exception e.g. if webUrl contains %, just ignore those cases.
             try {
             // URI.create can raise an exception e.g. if webUrl contains %, just ignore those cases.
             try {
-                String asciiWebUrl = URI.create(webUrl).toASCIIString();
+                asciiWebUrl = URI.create(webUrl).toASCIIString();
             } catch (Exception e) {
             } catch (Exception e) {
-                success = false;
             }
             }
-            if (success) {
+            if (asciiWebUrl != null) {
                 callback.builder.append("<p> <a href=\"");
                 callback.builder.append(asciiWebUrl);
                 callback.builder.append("\">");
                 callback.builder.append("<p> <a href=\"");
                 callback.builder.append(asciiWebUrl);
                 callback.builder.append("\">");