cecil
cecil copied to clipboard
ModuleDefinition.cs Mixin.GetFullyQualifiedName returns empty strings, breaking callers
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.
Note: I only ran into this because Visual Studio helpfully set the build configuration for Cecil to windows phone instead of Native. Regardless, confusing to debug because of the empty string.
Yup, makes sense.