Browse Source

Fixed some small potential crashes.

pull/187/head
Eric Kok 10 years ago
parent
commit
b8c2f430ad
  1. 2
      app/src/main/java/org/transdroid/core/gui/log/Log.java
  2. 2
      app/src/main/java/org/transdroid/daemon/Aria2c/Aria2Adapter.java

2
app/src/main/java/org/transdroid/core/gui/log/Log.java

@ -61,7 +61,7 @@ public class Log implements ITLogger {
DeleteBuilder<ErrorLogEntry, Integer> db = errorLogDao.deleteBuilder(); DeleteBuilder<ErrorLogEntry, Integer> db = errorLogDao.deleteBuilder();
db.setWhere(db.where().le(ErrorLogEntry.DATEANDTIME, new Date(new Date().getTime() - MAX_LOG_AGE))); db.setWhere(db.where().le(ErrorLogEntry.DATEANDTIME, new Date(new Date().getTime() - MAX_LOG_AGE)));
errorLogDao.delete(db.prepare()); errorLogDao.delete(db.prepare());
} catch (SQLException e) { } catch (Exception e) {
android.util.Log.e(LOG_NAME, "Cannot write log message to database: " + e.toString()); android.util.Log.e(LOG_NAME, "Cannot write log message to database: " + e.toString());
} }
} }

2
app/src/main/java/org/transdroid/daemon/Aria2c/Aria2Adapter.java

@ -236,9 +236,11 @@ public class Aria2Adapter implements IDaemonAdapter {
JSONArray signed = new JSONArray(); JSONArray signed = new JSONArray();
// Start with the secret token as parameter and then add the normal parameters // Start with the secret token as parameter and then add the normal parameters
signed.put("token:" + settings.getExtraPassword()); signed.put("token:" + settings.getExtraPassword());
if (params != null) {
for (int i = 0; i < params.length(); i++) { for (int i = 0; i < params.length(); i++) {
signed.put(params.get(i)); signed.put(params.get(i));
} }
}
params = signed; params = signed;
} }
JSONObject request = new JSONObject(); JSONObject request = new JSONObject();

Loading…
Cancel
Save