2002-10-16 Miguel de Icaza <miguel@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Wed, 16 Oct 2002 15:51:57 +0000 (15:51 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Wed, 16 Oct 2002 15:51:57 +0000 (15:51 -0000)
* driver.cs: Report an error if the resource file is not found
instead of crashing.

svn path=/trunk/mcs/; revision=8317

mcs/mcs/ChangeLog
mcs/mcs/driver.cs

index 7a76023de2d7bbe57398d15dd007c31f28888ad5..f7e76ca70e99a191d1dfb96853f34af5fdbad4d2 100755 (executable)
@@ -1,5 +1,8 @@
 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
 
+       * driver.cs: Report an error if the resource file is not found
+       instead of crashing.
+
        * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
        false, like Emit does.
 
index 6f75b6c179031f37b0b5d1b3c2b0d670a4d2df8e..75d394cb57ae5292dc41bb3c2a37e7be282175a4 100755 (executable)
@@ -1318,10 +1318,18 @@ namespace Mono.CSharp
                                                        margs [1] = spec.Substring (0, cp);
                                                } else
                                                        margs [0] = margs [1] = spec;
-                                               embed_res.Invoke (CodeGen.AssemblyBuilder, margs);
+
+                                               if (File.Exists ((string) margs [0]))
+                                                       embed_res.Invoke (CodeGen.AssemblyBuilder, margs);
+                                               else {
+                                                       Report.Error (1566, "Can not find the resource " + margs [0]);
+                                               }
                                        }
                                }
                        }
+
+                       if (Report.Errors > 0)
+                               return false;
                        
                        CodeGen.Save (output_file);
                        if (timestamps) {