File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ public function execute()
43
43
$ sitemap ->load ($ id );
44
44
// if sitemap record exists
45
45
if ($ sitemap ->getId ()) {
46
+
46
47
try {
47
48
//We need to emulate to get the correct frontend URL for the product images
48
49
$ this ->appEmulation ->startEnvironmentEmulation (
@@ -51,7 +52,6 @@ public function execute()
51
52
true
52
53
);
53
54
$ sitemap ->generateXml ();
54
- $ this ->appEmulation ->stopEnvironmentEmulation ();
55
55
56
56
$ this ->messageManager ->addSuccess (
57
57
__ ('The sitemap "%1" has been generated. ' , $ sitemap ->getSitemapFilename ())
@@ -60,6 +60,8 @@ public function execute()
60
60
$ this ->messageManager ->addError ($ e ->getMessage ());
61
61
} catch (\Exception $ e ) {
62
62
$ this ->messageManager ->addException ($ e , __ ('We can \'t generate the sitemap right now. ' ));
63
+ } finally {
64
+ $ this ->appEmulation ->stopEnvironmentEmulation ();
63
65
}
64
66
} else {
65
67
$ this ->messageManager ->addError (__ ('We can \'t find a sitemap to generate. ' ));
You can’t perform that action at this time.
0 commit comments