Skip to content

Commit

Permalink
Fixing type error
Browse files Browse the repository at this point in the history
  • Loading branch information
Maja Grubic committed Jan 6, 2020
1 parent 83b4d47 commit 377fd2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions x-pack/legacy/plugins/lens/public/app_plugin/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ export class AppPlugin {
const lensUrl = `${getKibanaBasePathFromDashboardUrl(
lastDashboardAbsoluteUrl
)}/lens/edit/${id}`;
if (lensUrl) {
const dashboardUrlWithoutTime = getDashboardUrlWithoutTime(lastDashboardAbsoluteUrl);
if (lensUrl && dashboardUrlWithoutTime) {
window.history.pushState({}, '', lensUrl);
const dashboardUrlWithoutTime = getDashboardUrlWithoutTime(lastDashboardAbsoluteUrl);
const dashboardParsedUrl = addEmbeddableToDashboardUrl(
dashboardUrlWithoutTime,
id,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/lens/public/app_plugin/url_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function addEmbeddableToDashboardUrl(
* output: http://localhost:5601/lib/app/kibana#/dashboard?_g=(refreshInterval:(pause:!t,value:0))
* @param url dashboard absolute url
*/
export function getDashboardUrlWithoutTime(url: string | undefined): string {
export function getDashboardUrlWithoutTime(url: string | undefined): string | null {
if (!url) {
return null;
}
Expand Down

0 comments on commit 377fd2b

Please sign in to comment.