[Libreoffice-commits] online.git: kit/Kit.cpp
Tor Lillqvist (via logerrit)
logerrit at kemper.freedesktop.org
Thu Aug 13 20:07:47 UTC 2020
kit/Kit.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 5df5329f837f242b9c9d4e2bede24931061325b4
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Aug 13 18:14:06 2020 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Aug 13 22:07:28 2020 +0200
Guard against view count being zero
Happened for me once in the iOS app, not sure if it was just a random
fluke while debugging, or whether it can happen in normal use. Anyway,
take it into consideration.
If the view count is zero, don't overwrite the '['.
Change-Id: Ia797d7cc99cc273e68ec184406f47283c9a647e2
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100672
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tor Lillqvist <tml at collabora.com>
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 42af4b531..8819947fd 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1033,7 +1033,8 @@ private:
oss << "\"color\":" << color << "},";
}
- oss.seekp(-1, std::ios_base::cur); // Remove last comma.
+ if (viewCount > 0)
+ oss.seekp(-1, std::ios_base::cur); // Remove last comma.
oss << ']';
// Broadcast updated viewinfo to all clients.
More information about the Libreoffice-commits
mailing list