[GODRIVER-245] Ensure methods of *Document handle the case where *Document is nil Created: 15/Feb/18 Updated: 28/Oct/23 Resolved: 23/Feb/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | 0.0.1 |
| Fix Version/s: | 0.0.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kristofer Brandow (Inactive) | Assignee: | Samuel Rossi (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Epic Link: | GODRIVER Alpha 2 UX |
| Description |
|
Currently, when *bson.Document is nil and we call methods on it, strange things happen, like panics during validation. For the methods of bson.Document that have a pointer receiver, add a check to ensure that the document itself is not nil and if it is either panic or return an error. For certain cases (like printing out the Document), we may want to print "<nil>" instead of return an error, or some other representation of a nil Document. |
| Comments |
| Comment by Githook User [ 23/Feb/18 ] |
|
Author: {'email': 'saghmrossi@gmail.com', 'name': 'Saghm Rossi', 'username': 'saghm'}Message: Change-Id: I2a5c6eb6118e3f057475a98bac87e4946beee0e7 |
| Comment by Samuel Rossi (Inactive) [ 22/Feb/18 ] |
|
Code review url: https://review.gerrithub.io/c/401062/ |