Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
10c83912
Unverified
Commit
10c83912
authored
Aug 31, 2019
by
D
Committed by
GitHub
Aug 31, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12876 from lzh984294471/3.6.5-dev
修复修改分类时空指针错误
parents
36835513
0fec767c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
src/main/java/org/b3log/solo/processor/console/CategoryConsole.java
...ava/org/b3log/solo/processor/console/CategoryConsole.java
+4
-0
src/main/java/org/b3log/solo/service/CategoryQueryService.java
...ain/java/org/b3log/solo/service/CategoryQueryService.java
+3
-1
No files found.
src/main/java/org/b3log/solo/processor/console/CategoryConsole.java
View file @
10c83912
...
...
@@ -154,6 +154,7 @@ public class CategoryConsole {
* @param context the specified request context
* @throws Exception exception
*/
@SuppressWarnings
(
"unchecked"
)
public
void
getCategory
(
final
RequestContext
context
)
{
final
JsonRenderer
renderer
=
new
JsonRenderer
();
context
.
setRenderer
(
renderer
);
...
...
@@ -169,6 +170,9 @@ public class CategoryConsole {
final
StringBuilder
tagBuilder
=
new
StringBuilder
();
final
List
<
JSONObject
>
tags
=
(
List
<
JSONObject
>)
result
.
opt
(
Category
.
CATEGORY_T_TAGS
);
for
(
final
JSONObject
tag
:
tags
)
{
if
(
tag
==
null
||
!
tag
.
has
(
Tag
.
TAG_TITLE
)){
continue
;
}
tagBuilder
.
append
(
tag
.
optString
(
Tag
.
TAG_TITLE
)).
append
(
","
);
}
tagBuilder
.
deleteCharAt
(
tagBuilder
.
length
()
-
1
);
...
...
src/main/java/org/b3log/solo/service/CategoryQueryService.java
View file @
10c83912
...
...
@@ -115,7 +115,9 @@ public class CategoryQueryService {
for
(
final
JSONObject
relation
:
relations
)
{
final
String
tagId
=
relation
.
optString
(
Tag
.
TAG
+
"_"
+
Keys
.
OBJECT_ID
);
final
JSONObject
tag
=
tagRepository
.
get
(
tagId
);
if
(
tag
==
null
){
continue
;
}
ret
.
add
(
tag
);
}
}
catch
(
final
RepositoryException
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment