summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Spiers <richard.spiers@gmail.com>2009-12-18 12:21:03 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-12-18 13:56:56 +0100
commit9203ed7c9a921bdbead2f2b9296311452b1b42f9 (patch)
tree9da46a869dd9556c6344bd89ad89eafe1efd7f19
parent8046a36bb47b415f8fa3fd8402abd35c8274e1f2 (diff)
Fix crash when assemblies have empty location string
Fixes bug #604810.
-rw-r--r--gstreamer-sharp/Application.cs13
1 files changed, 9 insertions, 4 deletions
diff --git a/gstreamer-sharp/Application.cs b/gstreamer-sharp/Application.cs
index 720c3c4..2084c42 100644
--- a/gstreamer-sharp/Application.cs
+++ b/gstreamer-sharp/Application.cs
@@ -74,13 +74,18 @@ namespace Gst {
foreach (Assembly asm in assemblies) {
foreach (AssemblyName ref_name in asm.GetReferencedAssemblies ()) {
- string asm_dir = Path.GetDirectoryName (asm.Location);
try {
Assembly ref_asm;
- if (File.Exists (Path.Combine (asm_dir, ref_name.Name + ".dll")))
- ref_asm = Assembly.LoadFrom (Path.Combine (asm_dir, ref_name.Name + ".dll"));
+ if (asm.Location != String.Empty)
+ {
+ string asm_file = Path.Combine(Path.GetDirectoryName(asm.Location), ref_name.Name + ".dll");
+ if (File.Exists(asm_file))
+ ref_asm = Assembly.LoadFrom(asm_file);
+ else
+ ref_asm = Assembly.Load(ref_name);
+ }
else
- ref_asm = Assembly.Load (ref_name);
+ ref_asm = Assembly.Load(ref_name);
Type[] ts = asm.GetTypes ();
foreach (Type t in ts) {