* java/lang/StringBuffer.java (insert(int,char[])): Avoid
NullPointerException so proper check of offset can be done.
From-SVN: r38132
+2000-12-08 Warren Levy <warrenl@redhat.com>
+
+ * java/lang/StringBuffer.java (insert(int,char[])): Avoid
+ NullPointerException so proper check of offset can be done.
+
2000-12-08 Warren Levy <warrenl@redhat.com>
* java/io/FileInputStream.java (close): Check if the fd is valid.
*/
public StringBuffer insert (int offset, char[] data)
{
- return insert (offset, data, 0, data.length);
+ // One could check if offset is invalid here instead of making sure that
+ // data isn't null before dereferencing, but this works just as well.
+ return insert (offset, data, 0, data == null ? 0 : data.length);
}
/** Insert the <code>char[]</code> argument into this