1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-17 02:44:04 +02:00

Pebble: try to prevent crash when no canned replies have been set

This commit is contained in:
Andreas Shimokawa 2018-11-07 22:02:58 +01:00
parent 5644ae5925
commit 78addcb75c

View File

@ -975,7 +975,7 @@ public class PebbleProtocol extends GBDeviceProtocol {
buf.put((byte) 0x01); // attribute id (title)
buf.putShort((short) act.title.getBytes().length);
buf.put(act.title.getBytes());
if(act.isReply && cannedReplies != null ) {
if (act.isReply && cannedReplies != null && cannedReplies.length > 0) {
buf.put((byte) 0x08); // canned replies
buf.putShort((short) replies_length);
for (int i = 0; i < cannedReplies.length - 1; i++) {