Skip to content

Commit

Permalink
Merge pull request #22 from djereg/master
Browse files Browse the repository at this point in the history
Cannot read property 'hasOwnProperty' of null
  • Loading branch information
Nodonisko committed Apr 12, 2017
2 parents 2b898f2 + fa0403d commit aef15b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cache.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ export class CacheService {
* @return {boolean} - data from cache
*/
public static isRequest(data: any): boolean {
if (data instanceof Request || (typeof data === 'object' && data.hasOwnProperty('_body') && data.hasOwnProperty('status') &&
if (data && (data instanceof Request || (typeof data === 'object' && data.hasOwnProperty('_body') && data.hasOwnProperty('status') &&
data.hasOwnProperty('statusText') && data.hasOwnProperty('type') && data.hasOwnProperty('headers')
&& data.hasOwnProperty('url'))) {
&& data.hasOwnProperty('url')))) {
return true;
} else {
return false;
Expand Down

0 comments on commit aef15b7

Please sign in to comment.