aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/service/protocol
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2011-12-21 14:07:56 +0000
committerDamian Minkov <damencho@jitsi.org>2011-12-21 14:07:56 +0000
commite560a364bbc59abb2f4c28ca4d08642f6404e83f (patch)
treedd7c7502cf337bdb9a462e4059122c590996d1a4 /src/net/java/sip/communicator/service/protocol
parent9559bab59672ef97c56c9a09ce3dbea404bf6c57 (diff)
downloadjitsi-e560a364bbc59abb2f4c28ca4d08642f6404e83f.zip
jitsi-e560a364bbc59abb2f4c28ca4d08642f6404e83f.tar.gz
jitsi-e560a364bbc59abb2f4c28ca4d08642f6404e83f.tar.bz2
Fixes NPE if resource icon is not found.
Diffstat (limited to 'src/net/java/sip/communicator/service/protocol')
-rw-r--r--src/net/java/sip/communicator/service/protocol/icqconstants/IcqStatusEnum.java3
-rw-r--r--src/net/java/sip/communicator/service/protocol/jabberconstants/JabberStatusEnum.java6
-rw-r--r--src/net/java/sip/communicator/service/protocol/msnconstants/MsnStatusEnum.java3
-rw-r--r--src/net/java/sip/communicator/service/protocol/yahooconstants/YahooStatusEnum.java3
4 files changed, 14 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/service/protocol/icqconstants/IcqStatusEnum.java b/src/net/java/sip/communicator/service/protocol/icqconstants/IcqStatusEnum.java
index 09daeb5..a7756c5 100644
--- a/src/net/java/sip/communicator/service/protocol/icqconstants/IcqStatusEnum.java
+++ b/src/net/java/sip/communicator/service/protocol/icqconstants/IcqStatusEnum.java
@@ -135,6 +135,9 @@ public class IcqStatusEnum
InputStream is = IcqStatusEnum.class.getClassLoader()
.getResourceAsStream(imagePath);
+ if(is == null)
+ return null;
+
byte[] icon = null;
try {
icon = new byte[is.available()];
diff --git a/src/net/java/sip/communicator/service/protocol/jabberconstants/JabberStatusEnum.java b/src/net/java/sip/communicator/service/protocol/jabberconstants/JabberStatusEnum.java
index 483fadd..0f4d8e2 100644
--- a/src/net/java/sip/communicator/service/protocol/jabberconstants/JabberStatusEnum.java
+++ b/src/net/java/sip/communicator/service/protocol/jabberconstants/JabberStatusEnum.java
@@ -270,6 +270,9 @@ public class JabberStatusEnum
{
InputStream is = getResourceAsStream(imagePath, clazz);
+ if(is == null)
+ return null;
+
byte[] icon = null;
try
{
@@ -283,7 +286,8 @@ public class JabberStatusEnum
finally {
try
{
- is.close();
+ if(is != null)
+ is.close();
}
catch (IOException ex)
{
diff --git a/src/net/java/sip/communicator/service/protocol/msnconstants/MsnStatusEnum.java b/src/net/java/sip/communicator/service/protocol/msnconstants/MsnStatusEnum.java
index c77160a..3c3298d 100644
--- a/src/net/java/sip/communicator/service/protocol/msnconstants/MsnStatusEnum.java
+++ b/src/net/java/sip/communicator/service/protocol/msnconstants/MsnStatusEnum.java
@@ -141,6 +141,9 @@ public class MsnStatusEnum
InputStream is = MsnStatusEnum.class.getClassLoader()
.getResourceAsStream(imagePath);
+ if(is == null)
+ return null;
+
byte[] icon = null;
try {
icon = new byte[is.available()];
diff --git a/src/net/java/sip/communicator/service/protocol/yahooconstants/YahooStatusEnum.java b/src/net/java/sip/communicator/service/protocol/yahooconstants/YahooStatusEnum.java
index 3056b7a..f66144b 100644
--- a/src/net/java/sip/communicator/service/protocol/yahooconstants/YahooStatusEnum.java
+++ b/src/net/java/sip/communicator/service/protocol/yahooconstants/YahooStatusEnum.java
@@ -174,6 +174,9 @@ public class YahooStatusEnum
InputStream is = YahooStatusEnum.class.getClassLoader()
.getResourceAsStream(imagePath);
+ if(is == null)
+ return null;
+
byte[] icon = null;
try {
icon = new byte[is.available()];