public SPListItemCollection GetACollection()
{
try
{
//Method to get an item collection from somewhere
if(itemCol != null)
return itemCol;
else
return null;
}
catch(Exception ex)
{
LogException(ex);
return null;
}
}
このメソッドは、例外がキャッチされるかどうかに関係なく、null (空のリストではない) を返す必要があります。上記は機能しますが、それを行うより良い方法はありますか?