pattern-lab / plugin-node-tab

ARCHIVED - The Tab plugin allows you to define additional code tabs to the pattern viewer / modal.
http://patternlab.io/
MIT License
5 stars 9 forks source link

Fix errors when file type not found for pattern #26

Open Josh68 opened 6 years ago

Josh68 commented 6 years ago

I kept getting errors if I didn't define scss or js files for patterns, if I had those types in my tabsToAdd option. I think this is a decent fix, but not sure why existing tabFileNameStats.isFile() was not preventing the attempt to copy a non-existent file. In this case, tabFileNameStats is definitively set to null unless the fs.statSync succeeds in the try block.