summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2013-10-01 18:38:18 (GMT)
committerRemko Tronçon <git@el-tramo.be>2013-10-01 18:38:18 (GMT)
commite3b455b57c9550128018bf9c22c27c1e6ed1f81f (patch)
tree8c03f8df473d88cbc50955194d3fa1e84d5b818b /Swiften
parentfd47dd7d5cec5155b9985959d2f0e0f3b386cd98 (diff)
downloadswift-e3b455b57c9550128018bf9c22c27c1e6ed1f81f.zip
swift-e3b455b57c9550128018bf9c22c27c1e6ed1f81f.tar.bz2
Fix bug on writing empty bytearray in file bytestream.
Change-Id: I55e79045d55c206d705609266262d734c4ed2853
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/FileTransfer/FileWriteBytestream.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Swiften/FileTransfer/FileWriteBytestream.cpp b/Swiften/FileTransfer/FileWriteBytestream.cpp
index 5725e18..6c11eb0 100644
--- a/Swiften/FileTransfer/FileWriteBytestream.cpp
+++ b/Swiften/FileTransfer/FileWriteBytestream.cpp
@@ -23,6 +23,9 @@ FileWriteBytestream::~FileWriteBytestream() {
}
void FileWriteBytestream::write(const std::vector<unsigned char>& data) {
+ if (data.empty()) {
+ return;
+ }
if (!stream) {
stream = new boost::filesystem::ofstream(file, std::ios_base::out|std::ios_base::binary);
}