mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +00:00
check strapi exists before running restore
This commit is contained in:
parent
db8dac601f
commit
7a9a1d27ba
@ -96,13 +96,13 @@ class LocalStrapiDestinationProvider implements IDestinationProvider {
|
||||
if (!this.strapi) {
|
||||
throw new Error('Not able to stream Configurations. Strapi instance not found');
|
||||
}
|
||||
const strapi = this.strapi;
|
||||
|
||||
return new Writable({
|
||||
objectMode: true,
|
||||
write: async (config: IConfiguration, _encoding, callback) => {
|
||||
try {
|
||||
if (this.options.strategy === 'restore') {
|
||||
await restoreConfigs(strapi, config);
|
||||
if (this.options.strategy === 'restore' && this.strapi) {
|
||||
await restoreConfigs(this.strapi, config);
|
||||
}
|
||||
callback();
|
||||
} catch (error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user