Fixes NPE if resource icon is not found.

cusax-fix
Damian Minkov 15 years ago
parent 9559bab596
commit e560a364bb

@ -135,6 +135,9 @@ public static byte[] loadIcon(String imagePath) {
InputStream is = IcqStatusEnum.class.getClassLoader()
.getResourceAsStream(imagePath);
if(is == null)
return null;
byte[] icon = null;
try {
icon = new byte[is.available()];

@ -270,6 +270,9 @@ public static byte[] loadIcon(String imagePath, Class<?> clazz)
{
InputStream is = getResourceAsStream(imagePath, clazz);
if(is == null)
return null;
byte[] icon = null;
try
{
@ -283,7 +286,8 @@ public static byte[] loadIcon(String imagePath, Class<?> clazz)
finally {
try
{
is.close();
if(is != null)
is.close();
}
catch (IOException ex)
{

@ -141,6 +141,9 @@ public static byte[] loadIcon(String imagePath) {
InputStream is = MsnStatusEnum.class.getClassLoader()
.getResourceAsStream(imagePath);
if(is == null)
return null;
byte[] icon = null;
try {
icon = new byte[is.available()];

@ -174,6 +174,9 @@ public static byte[] loadIcon(String imagePath) {
InputStream is = YahooStatusEnum.class.getClassLoader()
.getResourceAsStream(imagePath);
if(is == null)
return null;
byte[] icon = null;
try {
icon = new byte[is.available()];

Loading…
Cancel
Save