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
dms3
go-graphsync
Commits
8a792bbc
Commit
8a792bbc
authored
Mar 23, 2020
by
hannahhoward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(message): check for nil selector
check for nil selector in a request and error if it is present
parent
df4a18b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
message/message.go
message/message.go
+7
-3
No files found.
message/message.go
View file @
8a792bbc
...
@@ -259,9 +259,13 @@ func (gsm *graphSyncMessage) ToProto() (*pb.Message, error) {
...
@@ -259,9 +259,13 @@ func (gsm *graphSyncMessage) ToProto() (*pb.Message, error) {
pbm
:=
new
(
pb
.
Message
)
pbm
:=
new
(
pb
.
Message
)
pbm
.
Requests
=
make
([]
pb
.
Message_Request
,
0
,
len
(
gsm
.
requests
))
pbm
.
Requests
=
make
([]
pb
.
Message_Request
,
0
,
len
(
gsm
.
requests
))
for
_
,
request
:=
range
gsm
.
requests
{
for
_
,
request
:=
range
gsm
.
requests
{
selector
,
err
:=
ipldutil
.
EncodeNode
(
request
.
selector
)
var
selector
[]
byte
if
err
!=
nil
{
var
err
error
return
nil
,
err
if
request
.
selector
!=
nil
{
selector
,
err
=
ipldutil
.
EncodeNode
(
request
.
selector
)
if
err
!=
nil
{
return
nil
,
err
}
}
}
pbm
.
Requests
=
append
(
pbm
.
Requests
,
pb
.
Message_Request
{
pbm
.
Requests
=
append
(
pbm
.
Requests
,
pb
.
Message_Request
{
Id
:
int32
(
request
.
id
),
Id
:
int32
(
request
.
id
),
...
...
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