2003-02-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* glade/XML.custom: added a couple of checks for null.

svn path=/trunk/gtk-sharp/; revision=11435
This commit is contained in:
Gonzalo Paniagua Javier 2003-02-10 08:30:59 +00:00
parent fdaa84817e
commit 3c2f83a107
2 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2003-02-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* glade/XML.custom: added a couple of checks for null.
2003-02-09 Duncan Mak <duncan@ximian.com>
* sources/Gtk.metadata:
@ -37,6 +41,10 @@
2003-02-07 Martin Willemoes Hansen <mwh@sysrq.dk>
* Added a constructor to gdk/Point.custom
2003-02-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* sample/gconf/Makefile: defined top_builddir. RUNTIME is just 'mono'.
2003-02-06 Duncan Mak <duncan@ximian.com>
* sources/Gtk.metadata: Correct the metadata for the HTMLStream

View File

@ -70,6 +70,9 @@
/// correct Glade format</remarks>
public XML (System.IO.Stream s, string root, string domain)
{
if (s == null)
throw new ArgumentNullException ("s");
int size = (int) s.Length;
byte[] buffer = new byte[size];
s.Read (buffer, 0, size);
@ -84,10 +87,13 @@
public XML (System.Reflection.Assembly assembly, string resource_name, string root, string domain)
{
if (assembly == null)
{
assembly = System.Reflection.Assembly.GetCallingAssembly ();
}
System.IO.Stream s = assembly.GetManifestResourceStream (resource_name);
if (s == null)
throw new ArgumentException ("Cannot get resource file '" + resource_name + "'",
"resource_name");
int size = (int) s.Length;
byte[] buffer = new byte[size];
s.Read (buffer, 0, size);