Skip to content

Commit 425f53a

Browse files
committed
fix of #596
1 parent 9a1966b commit 425f53a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/controls/filePicker/FilePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class FilePicker extends React.Component<IFilePickerProps, IFilePickerSta
5555
public async componentDidMount() {
5656
// Load information about Organisation Assets Library
5757
let orgAssetsEnabled: boolean = false;
58-
if (this.props.hideOrganisationalAssetTab !== undefined && !this.props.hideOrganisationalAssetTab) {
58+
if (!this.props.hideOrganisationalAssetTab) {
5959
const orgAssetsLibraries = await this.orgAssetsService.getSiteMediaLibraries();
6060
orgAssetsEnabled = orgAssetsLibraries ? true : false;
6161
}

src/services/FileBrowserService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export class FileBrowserService {
268268
*/
269269
protected buildAbsoluteUrl = (relativeUrl: string) => {
270270
const siteUrl: string = GeneralHelper.getAbsoluteDomainUrl(this.context.pageContext.web.absoluteUrl);
271-
return siteUrl + relativeUrl;
271+
return `${siteUrl}${relativeUrl.indexOf('/') === 0 ? '' : '/'}${relativeUrl}`;
272272
}
273273

274274
protected processResponse = (fileResponse: any): void => {

src/services/OrgAssetsService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class OrgAssetsService extends FileBrowserService {
7373
absoluteUrl: this.buildAbsoluteUrl(libItem.LibraryUrl.DecodedUrl),
7474
title: libItem.DisplayName,
7575
serverRelativeUrl: libItem.LibraryUrl.DecodedUrl,
76-
iconPath: libItem.ThumbnailUrl.DecodedUrl ? this.buildAbsoluteUrl(`${this._orgAssetsLibraryServerRelativeSiteUrl}/${libItem.ThumbnailUrl.DecodedUrl}`) : null
76+
iconPath: libItem.ThumbnailUrl && libItem.ThumbnailUrl.DecodedUrl ? this.buildAbsoluteUrl(`${this._orgAssetsLibraryServerRelativeSiteUrl}/${libItem.ThumbnailUrl.DecodedUrl}`) : null
7777
};
7878

7979
return orgAssetsLibrary;

0 commit comments

Comments
 (0)