Skip to content

Commit

Permalink
HtmlPane: added css error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jusu committed Aug 20, 2018
1 parent 19a1b27 commit 9d63014
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/com/pinktwins/elephant/HtmlPane.java
Expand Up @@ -12,6 +12,7 @@
import javax.swing.text.html.HTMLEditorKit;

import com.pinktwins.elephant.data.Settings;
import com.pinktwins.elephant.eventbus.ToastEvent;
import com.pinktwins.elephant.util.IOUtil;

public class HtmlPane extends JTextPane {
Expand Down Expand Up @@ -57,7 +58,11 @@ private void setDocumentBase() {
} catch (Exception e) {
}

d.getStyleSheet().addRule(styles);
try {
d.getStyleSheet().addRule(styles);
} catch (Exception e) {
new ToastEvent("CSS error: " + e.getMessage()).post();
}
}

// hint by http://stackoverflow.com/a/19785465/873282
Expand Down

0 comments on commit 9d63014

Please sign in to comment.