Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Akamu
Game Server Go
Commits
bba97800
Commit
bba97800
authored
Oct 17, 2020
by
Julien Schröter
Committed by
Julien Schröter
Oct 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return empty explanation if question has no explanation
parent
b2442d5f
Pipeline
#2044
passed with stage
in 13 minutes and 53 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
endpoint/duel/query.go
endpoint/duel/query.go
+4
-1
No files found.
endpoint/duel/query.go
View file @
bba97800
...
@@ -1075,7 +1075,10 @@ func (m *MySQLDuelQuery) getExplanation(db dbhandler.DBAccess, questionID uint32
...
@@ -1075,7 +1075,10 @@ func (m *MySQLDuelQuery) getExplanation(db dbhandler.DBAccess, questionID uint32
res
:=
db
.
QueryRow
(
queryString
,
questionID
)
res
:=
db
.
QueryRow
(
queryString
,
questionID
)
if
errScan
:=
res
.
Scan
(
&
text
,
&
image
);
errScan
!=
nil
{
if
errScan
:=
res
.
Scan
(
&
text
,
&
image
);
errScan
==
sql
.
ErrNoRows
{
m
.
InsertReport
(
questionID
,
"AUTO-REPORT: Question has no explanation."
)
return
new
(
schemas
.
ExplanationSchema
),
nil
}
else
if
errScan
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to query explanation for question %d. %s SQL: %s"
,
questionID
,
errScan
.
Error
(),
queryString
)
return
nil
,
fmt
.
Errorf
(
"failed to query explanation for question %d. %s SQL: %s"
,
questionID
,
errScan
.
Error
(),
queryString
)
}
}
...
...
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