TypeError: Cannot read property 'save' of null ???
E:\NodeJs\Imooc\app.js:89
_movie.save(function(err,movie){
^
TypeError: Cannot read property 'save' of null
at E:\NodeJs\Imooc\app.js:89:10
下边是代码:
if(id!=='undefined'){
Movie.findById(id,function(err,movie){
if(err){
console.log(err);
}
_movie=_.extend(movie,movieObj);
_movie.save(function(err,movie){
if(err){
console.log(err);
}
res.redirect('/movie/'+movie._id);
})
})
}