1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

bug fixing

This commit is contained in:
Braun Patrik 2016-12-28 15:52:27 +01:00
parent d151c56e77
commit f5e51212d2
2 changed files with 8 additions and 6 deletions

View File

@ -44,7 +44,7 @@ export class GalleryManager implements IGalleryManager {
cb(null, dir); //WARNING: only on the fly indexing should happen after this point
//on the fly updating
this.indexDirectory(relativeDirectoryName, cb);
return this.indexDirectory(relativeDirectoryName, cb);
}
return this.indexDirectory(relativeDirectoryName, cb);

View File

@ -27,10 +27,12 @@ export class GridPhoto {
this.replacementSizeCache = null;
let size = this.getThumbnailSize();
for (let i = 0; i < this.photo.readyThumbnails.length; i++) {
if (this.photo.readyThumbnails[i] < size) {
this.replacementSizeCache = this.photo.readyThumbnails[i];
break;
if (!!this.photo.readyThumbnails) {
for (let i = 0; i < this.photo.readyThumbnails.length; i++) {
if (this.photo.readyThumbnails[i] < size) {
this.replacementSizeCache = this.photo.readyThumbnails[i];
break;
}
}
}
}
@ -42,7 +44,7 @@ export class GridPhoto {
}
isThumbnailAvailable() {
return this.photo.readyThumbnails.indexOf(this.getThumbnailSize()) != -1;
return this.photo.readyThumbnails && this.photo.readyThumbnails.indexOf(this.getThumbnailSize()) != -1;
}
getReplacementThumbnailPath() {