]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Controller/PocketController.php
Fix some Scrutinizer issues
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Controller / PocketController.php
index 1d80421923cac43ed008f2ff8317e2a583598271..11ce649d636952db55164b194fd780806678d326 100644 (file)
@@ -38,6 +38,15 @@ class PocketController extends Controller
         $requestToken = $this->get('wallabag_import.pocket.import')
             ->getRequestToken($this->generateUrl('import', array(), UrlGeneratorInterface::ABSOLUTE_URL));
 
+        if (false === $requestToken) {
+            $this->get('session')->getFlashBag()->add(
+                'notice',
+                'flashes.import.notice.failed'
+            );
+
+            return $this->redirect($this->generateUrl('import_pocket'));
+        }
+
         $this->get('session')->set('import.pocket.code', $requestToken);
         $this->get('session')->set('mark_as_read', $request->request->get('form')['mark_as_read']);