Skip to content

Commit

Permalink
Fix for nullable yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
3846masa committed Nov 1, 2017
1 parent 979601a commit 64e9a13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class Config {
return merged;
}

async write(opts: any, overwrite = false) {
async write(opts: any = {}, overwrite = false) {
const base = await this.load();
let merged: any;
if (overwrite) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/TemplatePackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default class TemplatePackage {
if (!await fs.pathExists(pluginConfigPath)) {
throw new Error(`"${info.https()}" hasn't "paperist.plugin.yml"`);
}
this.config = YAML.safeLoad(await fs.readFile(pluginConfigPath, 'utf8'));
this.config = YAML.safeLoad(await fs.readFile(pluginConfigPath, 'utf8')) || {};
}

async fetch() {
Expand Down

0 comments on commit 64e9a13

Please sign in to comment.