diff options
author | Sean Karlage <skarlage@fb.com> | 2018-08-15 10:20:05 -0700 |
---|---|---|
committer | Sean Karlage <skarlage@fb.com> | 2018-08-15 10:20:05 -0700 |
commit | d614fa996b8fb38528191fe52c258037ae9c539a (patch) | |
tree | daa404faab307d019d3222ab62bb17390e59e43a /dhcpv4/bsdp/bsdp_test.go | |
parent | 3a9b7911aa8d69f16a3d11bdaf2dc757470192d0 (diff) |
Add nil check for Images slice
Diffstat (limited to 'dhcpv4/bsdp/bsdp_test.go')
-rw-r--r-- | dhcpv4/bsdp/bsdp_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/dhcpv4/bsdp/bsdp_test.go b/dhcpv4/bsdp/bsdp_test.go index f457631..fc1aedf 100644 --- a/dhcpv4/bsdp/bsdp_test.go +++ b/dhcpv4/bsdp/bsdp_test.go @@ -80,6 +80,11 @@ func TestNewReplyForInformList_NoImages(t *testing.T) { DefaultImage: &fakeImage, }) require.Error(t, err) + + _, err = NewReplyForInformList(inform, ReplyConfig{ + Images: nil, + SelectedImage: &fakeImage, + }) } // TODO (get9): clean up when #99 lands. @@ -186,6 +191,12 @@ func TestNewReplyForInformSelect_NoImages(t *testing.T) { SelectedImage: &fakeImage, }) require.Error(t, err) + + _, err = NewReplyForInformSelect(inform, ReplyConfig{ + Images: nil, + SelectedImage: &fakeImage, + }) + require.Error(t, err) } func TestNewReplyForInformSelect(t *testing.T) { |