Skip to content

Commit 9da6ae7

Browse files
[FIX] GUI, HTML parsing, availability check
1 parent 63ad8fb commit 9da6ae7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

basex-core/src/main/java/org/basex/build/html/HtmlParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ static void ensureAvailable(final String className, final byte[] func,
324324
/**
325325
* Returns the parser associated with the specified HTML options.
326326
* @param options HTML options.
327-
* @return parser
327+
* @return parser (can be {@code null})
328328
*/
329329
public static Parser of(final HtmlOptions options) {
330330
return of(options, Parser.DEFAULT);

basex-core/src/main/java/org/basex/gui/dialog/DialogHtmlParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ final class DialogHtmlParser extends DialogParser {
3737
hopts = new HtmlOptions(opts.get(MainOptions.HTMLPARSER));
3838

3939
final Parser parser = Parser.of(hopts);
40-
final boolean avl = parser.available(hopts);
40+
final boolean available = parser != null && parser.available(hopts);
4141

4242
options = new BaseXTextField(dialog, hopts.toString());
4343
options.setToolTipText(tooltip(hopts));
4444
info = new BaseXLabel(" ").border(12, 0, 6, 0);
4545

4646
final BaseXBack pp = new BaseXBack(new RowLayout(8));
47-
pp.add(new BaseXLabel(avl ? Util.info(H_HTML_PARSER_X, parser) : H_NO_HTML_PARSER));
48-
if(avl) {
47+
pp.add(new BaseXLabel(available ? Util.info(H_HTML_PARSER_X, parser) : H_NO_HTML_PARSER));
48+
if(available) {
4949
final BaseXBack p = new BaseXBack(new ColumnLayout(8));
5050
p.add(new BaseXLabel(PARAMETERS + COL, true, true));
5151
p.add(options);

0 commit comments

Comments
 (0)