jbevain/cecil — Issue #79: ModuleDefinition.cs Mixin.GetFullyQualifiedName returns empty strings, breaking callers
Author: kevingadd
Created: 2011-10-25 04:26:40+00:00
State: open

public static string GetFullyQualifiedName (this Stream self)
{
#if !SILVERLIGHT
var file_stream = self as FileStream;
if (file_stream == null)
return string.Empty;

return Path.GetFullPath (file_stream.Name);
#else
return string.Empty;
#endif
}

This method is used in some parts of Cecil to get the path of an assembly. Returning string.Empty ends up causing a confusing exception later on when the return value is used. It'd be much easier to debug failures caused by this function if it threw instead. Alternately, return null, since an empty string is never a valid path anyway.