Skip to content

Commit

Permalink
fix(rest): fix crash when options is undefined in getServer
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Jul 25, 2017
1 parent e2e9d79 commit 7768b48
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rest/AbstractHTTP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ export abstract class AbstractHTTP implements IOnmsHTTP {
* with the HTTP implementation.
*/
protected getServer(options?: OnmsHTTPOptions) {
return options.server || this.serverObj;
if (options && options.server) {
return options.server;
}
return this.serverObj;
}

/**
Expand Down

0 comments on commit 7768b48

Please sign in to comment.