Improve error handling on sort

This commit is contained in:
zzz
2021-06-20 09:39:12 -04:00
parent fd6219356d
commit e5186b0f7b

View File

@@ -288,18 +288,16 @@ public class I2PDefaultServlet extends DefaultServlet
}
public int compare(String a, String b) {
Resource ra, rb;
try {
ra = _base.addPath(a);
rb = _base.addPath(b);
} catch (Exception e) {
Resource ra = _base.addPath(a);
Resource rb = _base.addPath(b);
boolean da = ra.isDirectory();
boolean db = rb.isDirectory();
if (da && !db) return -1;
if (!da && db) return 1;
} catch (Exception e) {
// see above
return 0;
}
boolean da = ra.isDirectory();
boolean db = rb.isDirectory();
if (da && !db) return -1;
if (!da && db) return 1;
return _coll.compare(a, b);
}
}