Merge pull request #158 from misaochan/ssl-exception

Fix SSL Excetption
This commit is contained in:
Nicolas Raoul 2016-07-06 15:25:37 +09:00 committed by GitHub
commit f5adb69c6f
3 changed files with 12 additions and 6 deletions

View file

@ -64,14 +64,14 @@ public class LicenseList {
} }
public String nameForTemplate(String template) { public String nameForTemplate(String template) {
Log.d("Commons", "LicenseList.nameForTemplate: template: " + template); //Log.d("Commons", "LicenseList.nameForTemplate: template: " + template);
String stringId = nameIdForTemplate(template); String stringId = nameIdForTemplate(template);
Log.d("Commons", "LicenseList.nameForTemplate: stringId: " + stringId); //Log.d("Commons", "LicenseList.nameForTemplate: stringId: " + stringId);
int nameId = stringIdByName(stringId); int nameId = stringIdByName(stringId);
Log.d("Commons", "LicenseList.nameForTemplate: nameId: " + nameId); //Log.d("Commons", "LicenseList.nameForTemplate: nameId: " + nameId);
if(nameId != 0) { if(nameId != 0) {
String name = res.getString(nameId); String name = res.getString(nameId);
Log.d("Commons", "LicenseList.nameForTemplate: name: " + name); //Log.d("Commons", "LicenseList.nameForTemplate: name: " + name);
return name; return name;
} }
return template; return template;

View file

@ -67,7 +67,9 @@ public class MethodAUpdater extends AsyncTask<Void, Void, ArrayList<String>> {
.get(); .get();
Log.d(TAG, "Method A URL filter" + result.toString()); Log.d(TAG, "Method A URL filter" + result.toString());
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); Log.e(TAG, "IO Exception: ", e);
//Return empty arraylist
return categories;
} }
ArrayList<ApiResult> categoryNodes = result.getNodes("/api/query/search/p/@title"); ArrayList<ApiResult> categoryNodes = result.getNodes("/api/query/search/p/@title");

View file

@ -11,6 +11,8 @@ import org.mediawiki.api.MWApi;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import javax.net.ssl.SSLPeerUnverifiedException;
import fr.free.nrw.commons.CommonsApplication; import fr.free.nrw.commons.CommonsApplication;
/** /**
@ -63,7 +65,9 @@ public class PrefixUpdater extends AsyncTask<Void, Void, ArrayList<String>> {
.get(); .get();
Log.d(TAG, "Prefix URL filter" + result.toString()); Log.d(TAG, "Prefix URL filter" + result.toString());
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); Log.e(TAG, "IO Exception: ", e);
//Return empty arraylist
return categories;
} }
ArrayList<ApiResult> categoryNodes = result.getNodes("/api/query/allcategories/c"); ArrayList<ApiResult> categoryNodes = result.getNodes("/api/query/allcategories/c");