Skip to content

Commit

Permalink
[db] Handle null in MAP_EMPTY_STR_TO_UNDEFINED
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusludmann committed Jun 15, 2021
1 parent b546641 commit 7be8e08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/gitpod-db/src/typeorm/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EncryptionService } from "@gitpod/gitpod-protocol/lib/encryption/encryp
export namespace Transformer {
export const MAP_EMPTY_STR_TO_UNDEFINED: ValueTransformer = {
to(value: any): any {
if (value === undefined) {
if (value === undefined || value === null) {

This comment has been minimized.

Copy link
@AlexTugarev

AlexTugarev Jun 18, 2021

Member

Thought about that as well.

@geropl recommendation was to add a separate transformer. AFAIU, in general it could make a difference to treat null differently, but I fully agree on the particular issue with the GitLab APIs, there we should not expect any problems.

return '';
}
return value;
Expand Down

0 comments on commit 7be8e08

Please sign in to comment.