Skip to content

Commit

Permalink
fix: handle when qNumFormat is null
Browse files Browse the repository at this point in the history
when the master measure formatting feature is in sense.
It may cause qNumFormat to be null so handle that case
  • Loading branch information
T-Wizard committed Jun 9, 2020
1 parent 9d6f437 commit d9da648
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/converthypercube.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ConvertHypercube {
qMax: max, //mesInfo.qMax,
qMin: min, //mesInfo.qMin,
qSortIndicator: mesInfo.qSortIndicator,
qNumFormat: {
qNumFormat: mesInfo.qNumFormat && {
qDec: mesInfo.qNumFormat.qDec,
qFmt: mesInfo.qNumFormat.qFmt,
qThou: mesInfo.qNumFormat.qThou,
Expand Down
2 changes: 1 addition & 1 deletion src/dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function initVarianceCube(component, layout) {

const measures = hyperCubeDef.qMeasures;
let expression;
if (JSON.stringify(measures[0].qDef.qNumFormat) === JSON.stringify(measures[1].qDef.qNumFormat)) {
if (JSON.stringify(measures[0].qDef.qNumFormat) === JSON.stringify(measures[1].qDef.qNumFormat) && measures[0].qDef.qNumFormat) {
let formatter;
switch (measures[0].qDef.qNumFormat.qType) {
case "D":
Expand Down

0 comments on commit d9da648

Please sign in to comment.