Skip to content

Commit

Permalink
Check existence of DataPkg props before accessing
Browse files Browse the repository at this point in the history
In MetadataView. Necessary because we removed two unused props from DataPackage.

Issue #2567
  • Loading branch information
robyngit committed Nov 14, 2024
1 parent 9bfd114 commit beb3de6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/views/MetadataView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2042,7 +2042,7 @@ define([
const packageSources = dataPackage.sourcePackages;
const packageDerivations = dataPackage.derivationPackages;

if (Object.keys(packageSources).length) {
if (packageSources && Object.keys(packageSources).length) {
const sourceProvChart = new ProvChart({
sources: packageSources,
context: dataPackage,
Expand All @@ -2053,7 +2053,7 @@ define([
this.subviews.push(sourceProvChart);
this.$(this.articleContainer).before(sourceProvChart.render().el);
}
if (Object.keys(packageDerivations).length) {
if (packageDerivations && Object.keys(packageDerivations).length) {
const derivationProvChart = new ProvChart({
derivations: packageDerivations,
context: dataPackage,
Expand All @@ -2066,8 +2066,8 @@ define([
}

if (
dataPackage.sources.length ||
dataPackage.derivations.length ||
dataPackage?.sources.length ||
dataPackage?.derivations.length ||
editModeOn
) {
// Draw the provenance charts for each member of this package at an
Expand Down

0 comments on commit beb3de6

Please sign in to comment.