Skip to content

Commit

Permalink
Fix potential error from undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Corey Robertson committed Oct 19, 2021
1 parent 340271f commit c76bd1a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ export function createSavedDashboardClass(
},

// if this is null/undefined then the SavedObject will be assigned the defaults
id: typeof arg === 'string' ? arg : arg.id,
id: typeof arg === 'object' ? arg.id : arg,

// default values that will get assigned if the doc is new
defaults,
});

const id: string = typeof arg === 'string' ? arg : arg.id;
const useResolve = typeof arg === 'string' ? false : arg.useResolve;
const id: string = typeof arg === 'object' ? arg.id : arg;
const useResolve = typeof arg === 'object' ? arg.useResolve : false;

this.getFullPath = () => `/app/dashboards#${createDashboardEditUrl(this.aliasId || this.id)}`;

Expand Down

0 comments on commit c76bd1a

Please sign in to comment.