Add exception trowing in case
peer object is not existing. (Stream closed, not created, etc)
This commit is contained in:
idk%eng.sun.com 1999-12-02 23:20:29 +00:00
Родитель 4aa8604576
Коммит c70494d02f
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -67,6 +67,14 @@ JNIEXPORT jint JNICALL Java_org_mozilla_pluglet_mozilla_PlugletInputStream_nativ
if (env->ExceptionOccurred()) {
return retval;
}
if (!input) {
jclass ex = env->FindClass("java/io/IOException");
if (!ex) {
return retval;
}
env->ThrowNew(ex,"Stream was closed");
return retval;
}
jbyte * bufElems = (jbyte*) malloc(sizeof(jbyte)*len);
if (!bufElems) {
return retval;