From a7493d98760ad602e9d8c1eb322d2ca85cef4759 Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Mon, 5 Oct 2009 08:08:39 +0000 Subject: [PATCH] Fix a bug in Msn Filetransfer preventing NullPointerException. And tests to recreate needed contacts for filetransfer tests. --- .../impl/protocol/msn/OperationSetFileTransferMsnImpl.java | 2 +- .../slick/protocol/msn/TestOperationSetFileTransferImpl.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/msn/OperationSetFileTransferMsnImpl.java b/src/net/java/sip/communicator/impl/protocol/msn/OperationSetFileTransferMsnImpl.java index 2245b4bf6..d19bc32d9 100644 --- a/src/net/java/sip/communicator/impl/protocol/msn/OperationSetFileTransferMsnImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/msn/OperationSetFileTransferMsnImpl.java @@ -94,7 +94,7 @@ public FileTransfer sendFile( Contact toContact, file); if(ft == null) - new IllegalStateException( + throw new IllegalStateException( "A problem occured sending file, contact not found or offline"); FileTransferImpl outFileTransfer = new FileTransferImpl( diff --git a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetFileTransferImpl.java b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetFileTransferImpl.java index dc9cedf7a..a9aec988f 100644 --- a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetFileTransferImpl.java +++ b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetFileTransferImpl.java @@ -143,8 +143,10 @@ public void prepareContactList() throws Exception { // clear the provider the first time we run a filetransfer list - if(getContact1() == null && getContact2() == null) + if(contact1 == null && contact2 == null) + { fixture.clearProvidersLists(); + } if(getContact1() == null) {