It is possible for the SPropTagArray to not be initialized during the GetNamesFromIDs() call which causes a crash when passed to PyMAPIObject_FromSPropTagArray(). This patch tests for null, and uses PyTuple_New(0) in its place.
Thanks - but I decided to fix this directly in PyMAPIObject_FromSPropTagArray (so all other callers of this don't crash in similar ways) but I changed it to return None instead of an empty tuple (there may be a case where the caller cares about the distinction between null and an empty array. Let me know if this causes you any problems.
Revision 4382:8c70bcb663b9
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Regarding using None instead of an empty tuple, I believe your change is the correct choice. I cannot seem to find anything in the msdn documentation that documents this behavior for an invalid PropSetGuid. At least not explicitly in the various result scenarios documented. So it's probably best not to mask it as you pointed out.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks - but I decided to fix this directly in PyMAPIObject_FromSPropTagArray (so all other callers of this don't crash in similar ways) but I changed it to return None instead of an empty tuple (there may be a case where the caller cares about the distinction between null and an empty array. Let me know if this causes you any problems.
Revision 4382:8c70bcb663b9
Regarding using None instead of an empty tuple, I believe your change is the correct choice. I cannot seem to find anything in the msdn documentation that documents this behavior for an invalid PropSetGuid. At least not explicitly in the various result scenarios documented. So it's probably best not to mask it as you pointed out.