[GODRIVER-596] Check value validity in isZero function Created: 11/Oct/18  Updated: 28/Oct/23  Resolved: 11/Oct/18

Status: Closed
Project: Go Driver
Component/s: BSON
Affects Version/s: 0.0.15
Fix Version/s: 0.0.16

Type: Bug Priority: Major - P3
Reporter: Kristofer Brandow (Inactive) Assignee: Go Community User
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If the value is nil then using Interface method on it causes panic. For example, write following struct
type State struct { Value struct { Object interface{} `bson:",omitempty"` } }
with the following value:
s := State{} s.Value.Object = nil
case panic if there is not check for validity.



 Comments   
Comment by Githook User [ 11/Oct/18 ]

Author:

{'name': 'Kris Brandow', 'email': 'kris@mongodb.com', 'username': 'skriptble'}

Message: Merge branch 'pr/95'

GODRIVER-596

Change-Id: Ib38f020b5dacddb50a7fb9eb9bae0ac227b9d816
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/16cda522af7bfe5a8231ed38c5deb792cb7d8e20

Comment by Kristofer Brandow (Inactive) [ 11/Oct/18 ]

Code Review: https://github.com/mongodb/mongo-go-driver/pull/95.

Generated at Thu Feb 08 08:34:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.