mirror of
https://github.com/vale981/apollo-server
synced 2025-03-06 02:01:40 -05:00
apollo-server-core: add check for null property in ApolloError
This commit is contained in:
parent
0fe53a68da
commit
c4e3766475
1 changed files with 6 additions and 3 deletions
|
@ -10,9 +10,12 @@ export class ApolloError extends Error {
|
|||
) {
|
||||
super(message);
|
||||
|
||||
Object.keys(properties).forEach(key => {
|
||||
this[key] = properties[key];
|
||||
});
|
||||
if (properties) {
|
||||
Object.keys(properties).forEach(key => {
|
||||
this[key] = properties[key];
|
||||
});
|
||||
}
|
||||
|
||||
//extensions are flattened to be included in the root of GraphQLError's, so
|
||||
//don't add properties to extensions
|
||||
this.extensions = { code };
|
||||
|
|
Loading…
Add table
Reference in a new issue