kit/Kit.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 5df5329f837f242b9c9d4e2bede24931061325b4
Author:     Tor Lillqvist <[email protected]>
AuthorDate: Thu Aug 13 18:14:06 2020 +0300
Commit:     Tor Lillqvist <[email protected]>
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 <[email protected]>
    Reviewed-by: Tor Lillqvist <[email protected]>

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.
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to