Commit 72307a429e18c2b9768cb4bd088443ad1f8a1d84

Authored by Adhidarma Hadiwinoto
1 parent 043c782987
Exists in master

balanceFromMessage

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

... ... @@ -256,15 +256,16 @@ function balanceCheck() {
256 256 }
257 257  
258 258 function balanceFromMessage(message) {
259   - matches = message.match(/Saldo: Rp (\d+)/);
  259 + var matches = message.match(/Saldo: Rp (\d+)/);
  260 +
260 261 if (!matches) {
261 262 return null;
262 263 }
263   -
264   - if (matches.length <= 1) {
  264 + if (matches.length < 2) {
265 265 return null;
266 266 }
267   - return matches[0];
  267 +
  268 + return matches[1];
268 269 }
269 270  
270 271 function start(_config, _callbackReport) {