title: Call to a member function move() on null
body: <p>I cannot figure out how to resolve this issue. It seems when I try to create my article page if I don't select a img it fails with null error. Anyone have any insight?</p>
  
  <p>Error Is Produced via debug mode.  Call to a member function move() on null. /home/UNIT3D/app/controllers/Admin/ArticleController.php </p>
  
  <pre><code>    $post-&gt;image = null;
      }
  
      $v = Validator::make($post-&gt;toArray(), $post-&gt;rules);
      if($v-&gt;fails())
      {
          // Suppression de l'image car la validation a échoué
          if(file_exists(Input::file('image')-&gt;move(getcwd() . '/files/img/' . $post-&gt;image)))    
          {
              unlink(Input::file('image')-&gt;move(getcwd() . '/files/img/' . $post-&gt;image));
  </code></pre>
  
  <p>Full File</p>
  
  <pre><code> &lt;?php   
  
      namespace Admin;
  
      use \View;
      use \Request;
      use \Input;
      use \Auth;
      use \Redirect;
      use \Validator;
      use \Session;
  
      use \Illuminate\Support\Str;
      use \Article;
  
      class ArticleController extends \BaseController {
  
          /**
           * Affiche la page d'administration des articles
           *
           * @access public
           * @return post.admin_index_post
           */
          public function index()
          {
              $posts = Article::orderBy('created_at', 'DESC')-&gt;paginate(20);
              return View::make('Admin.article.index', array('posts' =&gt; $posts));
          }
  
          /**
           * Ajoute un article
           *
           * @access public
           * @return post.admin_add_post
           */
          public function add()
          {
              if(Request::isMethod('post'))
              {
                  $input = Input::all();
                  $post = new Article();
                  $post-&gt;title = $input['title'];
                  $post-&gt;slug = Str::slug($post-&gt;title);
                  $post-&gt;content = $input['content'];
                  //$post-&gt;user_id = Auth::user()-&gt;id;
                  // Verifie qu'une image à était upload
                  if(Input::hasFile('image') &amp;&amp; Input::file('image')-&gt;getError() == 0)
                  {
                      // Le fichier est bien une image
                      if(in_array(Input::file('image')-&gt;getClientOriginalExtension(), array('jpg', 'jpeg', 'bmp', 'png', 'tiff')))
                      {
                          // Déplace et ajoute le nom à l'objet qui sera sauvegarder
                          $post-&gt;image = 'article-' . uniqid() . '.' . Input::file('image')-&gt;getClientOriginalExtension();
                          Input::file('image')-&gt;move(getcwd() . '/files/img/', $post-&gt;image);
                      }
                      else
                      {
                          // Image null car invalide ou mauvais format
                          $post-&gt;image = null;
                      }
                  }
                  else
                  {
                      // Erreur sur l'image donc null
                      $post-&gt;image = null;
                  }
  
                  $v = Validator::make($post-&gt;toArray(), $post-&gt;rules);
                  if($v-&gt;fails())
                  {
                      // Suppression de l'image car la validation a échoué
                      if(file_exists(Input::file('image')-&gt;move(getcwd() . '/files/img/' . $post-&gt;image)))    
                      {
                          unlink(Input::file('image')-&gt;move(getcwd() . '/files/img/' . $post-&gt;image));
                      }
                      Session::put('message', 'An error has occured');
                  }
                  else
                  {
                      Auth::user()-&gt;articles()-&gt;save($post);
                      return Redirect::route('admin_article_index')-&gt;with('message', 'Your article has been published');
                  }
              }
              return View::make('Admin.article.add');
          }
  
          /**
           * Edite l'article voulu
           *
           * @access public
           * @param $slug Slug de l'article à édité
           * @param $id Id de l'article
           * @return post.admin_edit_post
           */
          public function edit($slug, $id)
          {
              $post =  Article::find($id);
              if(Request::isMethod('post'))
              {
                  $input = Input::all();
                  $post-&gt;title = $input['title'];
                  $post-&gt;slug = Str::slug($post-&gt;title);
                  $post-&gt;content = $input['content'];
                  //$post-&gt;user_id = Auth::user()-&gt;id;
  
                  // Verifie qu'une image à était upload
                  if(Input::hasFile('image') &amp;&amp; Input::file('image')-&gt;getError() == 0)
                  {
                      // Le fichier est bien une image
                      if(in_array(Input::file('image')-&gt;getClientOriginalExtension(), array('jpg', 'jpeg', 'bmp', 'png', 'tiff')))
                      {
                          // Déplace et ajoute le nom à l'objet qui sera sauvegarder
                          $post-&gt;image = 'article-' . uniqid() . '.' . Input::file('image')-&gt;getClientOriginalExtension();
                          Input::file('image')-&gt;move(getcwd() . '/files/img/', $post-&gt;image);
                      }
                      else
                      {
                          // Image null car invalide ou mauvais format
                          $post-&gt;image = null;
                      }
                  }
                  else
                  {
                      // Erreur sur l'image donc null
                      $post-&gt;image = null;
                  }
  
                  $v = Validator::make($post-&gt;toArray(), $post-&gt;rules);
                  if($v-&gt;fails())
                  {
                      Session::put('message', 'An error has occured');
                  }
                  else
                  {
                      $post-&gt;save();
                      return Redirect::route('admin_article_index')-&gt;with('message', 'Your article has been modified');
                  }
              }
              return View::make('Admin.article.edit', array('post' =&gt; $post));
          }
  
          /**
           * Supprime l'article désiré
           *
           * @access public
           * @param $slug Slug de l'article
           * @param $id Id de l'article
           * @return void
           */
          public function delete($slug, $id)
          {
              $post = Article::find($id);
              $post-&gt;delete();
              return Redirect::route('admin_article_index')-&gt;with('message', 'This article has been deleted');
          }
      } ?&gt;
  </code></pre>