Skip to content

Commit e522789

Browse files
author
Emmanouil Konstantinidis
committed
Cover case of 500
1 parent 60ef1d0 commit e522789

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rest_framework_docs/static/rest_framework_docs/js/components/response.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var Response = React.createClass({
3131
}
3232

3333
var responseJSON = JSONpp.prettyPrint(this.state.payload.body);
34-
var hasToken = this.state.payload.body.hasOwnProperty('token');
34+
var hasToken = this.state.payload.body ? this.state.payload.body.hasOwnProperty('token') : false;
3535
var statusText = this.state.payload.statusText.toLowerCase();
3636
var statusCodeFirstChar = String(this.state.payload.status).charAt(0);
3737
var statusCodeClass = 'label status-code pull-right status-code-' + statusCodeFirstChar;

0 commit comments

Comments
 (0)