From 59ef709f1969155915e9262936b04e549fae3cc2 Mon Sep 17 00:00:00 2001
From: Adhidarma Hadiwinoto <me@adhisimon.org>
Date: Thu, 5 Dec 2019 17:02:16 +0700
Subject: [PATCH] Bugfix on deteksi msgHead empty

---
 lib/transport.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/transport.js b/lib/transport.js
index 8e265e8..c015484 100644
--- a/lib/transport.js
+++ b/lib/transport.js
@@ -13,7 +13,7 @@ async function sendToModem(partner, msg, modem, parentXid) {
     const xid = parentXid || uniqid();
 
     const [msgHead, msgTail] = messageSplitter(msg.trim(), 160);
-    if (msgHead) {
+    if (!msgHead) {
         return;
     }
 
@@ -66,6 +66,11 @@ exports.send = async (partner, msg) => {
     if (typeof msg !== 'string' || !msg.trim()) return;
 
     const xid = uniqid();
+    logger.info('TRANSPORT: Got CORE message to forward to EVO-CP', {
+        xid,
+        partner,
+        msg,
+    });
 
     const modem = modems.randomModem();
     if (!modem) {
-- 
1.9.0