Skip to content

Commit

Permalink
🔧 Improve plan 字段在更新后不存在 Exception 异常报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
adlered committed Jun 28, 2021
1 parent a8600f7 commit dabe514
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
17 changes: 17 additions & 0 deletions src/main/java/org/b3log/solo/bolo/prop/FaviconCache.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Bolo - A stable and beautiful blogging system based in Solo.
* Copyright (c) 2020, https://github.com/adlered
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.b3log.solo.bolo.prop;

public class FaviconCache {
Expand Down
15 changes: 9 additions & 6 deletions src/main/java/org/b3log/solo/improve/ImproveOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ public class ImproveOptions {
* false/true:用户已设置
*/
public static String doJoinHelpImprovePlan() {
if (doJoin.isEmpty()) {
final BeanManager beanManager = BeanManager.getInstance();
final OptionQueryService optionQueryService = beanManager.getReference(OptionQueryService.class);
final JSONObject preference = optionQueryService.getPreference();
doJoin = preference.getString(Option.ID_C_HELP_IMPROVE_PLAN);
try {
if (doJoin.isEmpty()) {
final BeanManager beanManager = BeanManager.getInstance();
final OptionQueryService optionQueryService = beanManager.getReference(OptionQueryService.class);
final JSONObject preference = optionQueryService.getPreference();
doJoin = preference.getString(Option.ID_C_HELP_IMPROVE_PLAN);
}
} catch (Exception e) {
return "";
}

return doJoin;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.b3log.solo.util.Markdowns;
import org.b3log.solo.util.PluginUtil;
import org.b3log.solo.util.Solos;
import org.json.JSONException;
import org.json.JSONObject;

import javax.servlet.ServletOutputStream;
Expand Down

0 comments on commit dabe514

Please sign in to comment.