Skip to content

Commit

Permalink
Modified the 'VirtualFileSystemResource' class to test the type of th…
Browse files Browse the repository at this point in the history
…e constructor argument based on it's properties instead of it's constructor
  • Loading branch information
AdrienCastex committed Aug 21, 2017
1 parent f037c36 commit 2f012cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/manager/v2/instances/VirtualFileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var Path_1 = require("../Path");
var VirtualFileSystemResource = (function () {
function VirtualFileSystemResource(data) {
var rs;
if (data.constructor === export_1.ResourceType) {
if (data && data.isFile !== undefined && data.isDirectory !== undefined) {
rs = {
type: data
};
Expand Down
2 changes: 1 addition & 1 deletion src/manager/v2/instances/VirtualFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class VirtualFileSystemResource
constructor(data : VirtualFileSystemResource | ResourceType)
{
let rs : VirtualFileSystemResource;
if(data.constructor === ResourceType)
if(data && (data as ResourceType).isFile !== undefined && (data as ResourceType).isDirectory !== undefined)
{
rs = {
type: data as ResourceType
Expand Down

0 comments on commit 2f012cd

Please sign in to comment.