datajunction-ui 0.0.136 → 0.0.138

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datajunction-ui",
3
- "version": "0.0.136",
3
+ "version": "0.0.138",
4
4
  "description": "DataJunction UI",
5
5
  "module": "src/index.tsx",
6
6
  "repository": {
@@ -286,6 +286,14 @@ export function QueryPlannerPage() {
286
286
  setDimensionsLoading(true);
287
287
  try {
288
288
  const dims = await djClient.commonDimensions(selectedMetrics);
289
+ // Server returns an error body (e.g. {message: "..."}) on 404/422 with
290
+ // a non-OK status, but commonDimensions() doesn't surface that — guard
291
+ // against passing a non-array into setCommonDimensions.
292
+ if (!Array.isArray(dims)) {
293
+ console.error('commonDimensions returned non-array:', dims);
294
+ setCommonDimensions([]);
295
+ return;
296
+ }
289
297
  setCommonDimensions(dims);
290
298
 
291
299
  // Apply pending dimensions from URL if we have them