Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
fix(order dlg): check when pips are undefined
Browse files Browse the repository at this point in the history
This fix avoids an error when the order dialog is opened before the first quote
for that instrument is pushed.
  • Loading branch information
albertosantini committed Jan 5, 2016
1 parent 9b1ae34 commit 5e8c5ab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/client/app/charts/order-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@

function changeMarket(instrument) {
var price = quotesService.getQuotes()[instrument],
fixed = (pips[vm.selectedInstrument].match(/0/g) || []).length;
fixed;

if (!pips) {
return;
}

fixed = (pips[vm.selectedInstrument].match(/0/g) || []).length;

vm.measure = "price";
vm.step = parseFloat(pips[vm.selectedInstrument]);
Expand Down

0 comments on commit 5e8c5ab

Please sign in to comment.