bradtraversy / nodekb

Simple knowledgebase app with Node.js, Express and MongoDB
304 stars 185 forks source link

Cannot read property '_id' of null #11

Closed Anirog closed 4 years ago

Anirog commented 4 years ago

Getting the following error after changing the 'edit_article.pug' file:

Cannot read property '_id' of null

My code is:

extends layout

block content h1 #{title} form(method='POST', action='/articles/edit/'+article._id)

form-group

  label Title:
  input.form-control(name='title', type='text', value=article.title)
#form-group
  label Author:
  input.form-control(name='author', type='text', value=article.author)
#form-group
  label Body:
  textarea.form-control(name='body') article.body
input.btn.btn-primary(type='submit',value='Submit')