Skip to content

Commit

Permalink
apollo-server-core: add check for null property in ApolloError
Browse files Browse the repository at this point in the history
  • Loading branch information
evans committed May 3, 2018
1 parent 2a36f0f commit f1c1e79
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/apollo-server-core/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down

0 comments on commit f1c1e79

Please sign in to comment.