Fixing various NRE

This commit is contained in:
Christian 'ketura' McCarty
2024-12-07 09:53:20 -06:00
parent e11f52b193
commit 0fa5a42bd5
3 changed files with 22 additions and 7 deletions

View File

@@ -219,8 +219,8 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri
private boolean IgnoreError(Exception ex) {
String msg = ex.getMessage();
if(msg != null && msg.contains("You don't have a deck registered yet") ||
msg.contains("Your selected deck is not valid for this format"))
if(msg != null && (msg.contains("You don't have a deck registered yet") ||
msg.contains("Your selected deck is not valid for this format")))
return true;
return false;

View File

@@ -860,18 +860,28 @@ var CardFilter = Class.extend({
sort = " sort:" + sort;
var format = this.currentFormat;
if (format)
if (format) {
format = " format:" + format;
else
}
else {
format = "";
}
var block = $("#blockSelect option:selected").prop("value");
if (block)
if (block) {
block = " block:" + block;
}
else {
block = "":
}
var set = $("#setSelect option:selected").prop("value");
if (set)
if (set) {
set = " set:" + set;
}
else {
set = "";
}
var cardType = $("#cardTypeSelect option:selected").prop("value");
if (cardType != "")

View File

@@ -74,7 +74,12 @@ public class SortAndFilterCards {
//Cache our looked-up blueprints so we're not always re-searching; also used later for sorting
try {
if(!cardBPCache.containsKey(blueprintId)) {
cardBPCache.putIfAbsent(blueprintId, cardLibrary.getLotroCardBlueprint(blueprintId));
var bp = cardLibrary.getLotroCardBlueprint(blueprintId);
//TODO: log this
if(bp == null)
continue;
cardBPCache.putIfAbsent(blueprintId, bp);
}
} catch (CardNotFoundException ignored) {
// Ignore the card