We are busy upgrading 2009 to 2011 and found an annoying difference between the TOM.Net API for both versions. If you try to create a TcmUri object with the single-argument constructor, and the value of the argument is null, the behavior is different:
// 2009
TcmUri uri = new TcmUri(null);
log.Debug("found uri " + uri.ToString());
// the log shows 'found uri tcm:0-0-0'
// 2011
TcmUri uri = new TcmUri(null);
// the code breaks here with exception 'Null is not allowed'
log.Debug("found uri " + uri.ToString());
Of course, we don't pass 'null' on purpose. But we have many situations where we configure a uri through a package variable. When the variable isn't in the package, we end up with the null value.
Did anyone encounter the same problem? If so, how did you solve it?