Commit 7dac01eb079a7e884a9537352158bcb34c3ef451

Authored by Adhidarma Hadiwinoto
1 parent 33c0c747a1
Exists in master

penanganan missing config.commands sehingga bisa dipakai http get

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

center/messaging/trx-center.js
... ... @@ -25,10 +25,10 @@ function onIncomingMessage(paramsFromTransport) {
25 25  
26 26 const command = paramsFromTransport.msg.split(/[\., ]+/)[0].toUpperCase();
27 27  
28   - if (config.commands.balance.indexOf(command) >= 0) {
  28 + if (config.commands && config.commands.balance.indexOf(command) >= 0) {
29 29 executeBalanceCheck(paramsFromTransport);
30 30 }
31   - else if (config.commands.price.indexOf(command) >= 0) {
  31 + else if (config.commands && config.commands.price.indexOf(command) >= 0) {
32 32 executePriceCheck(paramsFromTransport);
33 33 }
34 34 else {
... ... @@ -94,7 +94,7 @@ function executePrepaidBuy(paramsFromTransport) {
94 94 msg: paramsFromTransport.msg
95 95 }
96 96  
97   - if (!qs.do_not_prefix_request_id) {
  97 + if (!config.do_not_prefix_request_id) {
98 98 qs.request_id = generateRequestId(qs);
99 99 if (tokens[3]) {
100 100 qs.request_id += '_' + tokens[3];