Skip to content

Commit 374f11e

Browse files
committed
fix: handle empty picture error
1 parent 65c91a2 commit 374f11e

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

protoc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
protoc --proto_path=../googleapis/ --proto_path=. --plugin=protoc-gen-ng=./node_modules/.bin/protoc-gen-ng --ng_out=src/grpc -I ../goautowp spec.proto
3+
protoc --proto_path=node_modules/google-proto-files/ --proto_path=. --plugin=protoc-gen-ng=./node_modules/.bin/protoc-gen-ng --ng_out=src/grpc -I ../goautowp spec.proto

src/app/catalogue/concepts/concepts.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ export class CatalogueConceptsComponent {
8484
const items: CatalogueListItem[] = response.items.map((item) => {
8585
const pictures: CatalogueListItemPicture[] = item.preview_pictures.pictures.map((picture) => ({
8686
picture: picture?.picture ? picture.picture : null,
87-
routerLink:
88-
item.route && picture && picture.picture ? item.route.concat(['pictures', picture.picture.identity]) : [],
87+
routerLink: item.route && picture?.picture ? item.route.concat(['pictures', picture.picture.identity]) : [],
8988
thumb: picture ? picture.thumb : null,
9089
}));
9190

src/app/catalogue/engines/engines.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class CatalogueEnginesComponent {
8787

8888
const pictures: CatalogueListItemPicture[] = item.item.preview_pictures.pictures.map((picture) => ({
8989
picture: picture?.picture ? picture.picture : null,
90-
routerLink: picture && picture.picture ? routerLink.concat(['pictures', picture.picture.identity]) : [],
90+
routerLink: picture?.picture ? routerLink.concat(['pictures', picture.picture.identity]) : [],
9191
thumb: picture ? picture.thumb : null,
9292
}));
9393

src/app/categories/list-item.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class CategoriesListItemComponent {
5050
]).pipe(
5151
map(([item, parentRouterLink]) =>
5252
item.preview_pictures.pictures.map((pic) => ({
53-
picture: pic.picture ? pic.picture : null,
53+
picture: pic?.picture ? pic.picture : null,
5454
route:
5555
pic && pic.picture && parentRouterLink ? parentRouterLink.concat(['pictures', pic.picture.identity]) : null,
5656
thumb: pic.thumb ? pic.thumb : null,

0 commit comments

Comments
 (0)