Skip to content

Commit 3d1e498

Browse files
authored
fix illegal argument
2 parents cef30cc + 198dbed commit 3d1e498

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/main/java/com/shuzijun/leetcode/plugin/window/login/LoginPanel.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ public LoginPanel(@Nullable Project project) {
5353
if (HttpLogin.isEnabledJcef()) {
5454
okAction = new OkAction() {
5555
};
56-
jcefPanel = new JcefPanel(project, okAction);
56+
try {
57+
jcefPanel = new JcefPanel(project, okAction);
58+
} catch (IllegalArgumentException e) {
59+
jcefPanel = new JcefPanel(project, okAction,true);
60+
}
5761
jcefPanel.getComponent().setMinimumSize(new Dimension(1000, 500));
5862
jcefPanel.getComponent().setPreferredSize(new Dimension(1000, 500));
5963
panel.addToCenter(new JBScrollPane(jcefPanel.getComponent(), JBScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JBScrollPane.HORIZONTAL_SCROLLBAR_NEVER));
@@ -145,10 +149,21 @@ private static class JcefPanel extends JCEFHtmlPanel {
145149

146150
private Action okAction;
147151

152+
public JcefPanel(Project project, Action okAction, boolean old) {
153+
super( null);
154+
this.project = project;
155+
this.okAction = okAction;
156+
init();
157+
}
158+
148159
public JcefPanel(Project project, Action okAction) {
149160
super(null, null);
150161
this.project = project;
151162
this.okAction = okAction;
163+
init();
164+
}
165+
166+
private void init(){
152167
getJBCefClient().addLoadHandler(cefLoadHandler = new CefLoadHandlerAdapter() {
153168

154169
boolean successDispose = false;

0 commit comments

Comments
 (0)