Skip to content

Commit

Permalink
fix(server/photo): handle null data for images
Browse files Browse the repository at this point in the history
  • Loading branch information
itschip committed Dec 1, 2021
1 parent 483325f commit 1a905df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion import.sql
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,6 @@ CREATE TABLE IF NOT EXISTS npwd_phone_gallery
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`identifier` varchar(48) DEFAULT NULL,
`image` varchar(255) DEFAULT NULL,
`image` varchar(255) NOT NULL,
PRIMARY KEY (id)
);
2 changes: 2 additions & 0 deletions resources/server/photo/photo.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class _PhotoService {
resp: PromiseEventResp<GalleryPhoto>,
): Promise<void> {
try {
if (!reqObj.data) resp({ status: 'error', errorMsg: 'DB_ERROR' });

const identifier = PlayerService.getIdentifier(reqObj.source);
const photo = await this.photoDB.uploadPhoto(identifier, reqObj.data);

Expand Down

0 comments on commit 1a905df

Please sign in to comment.