Skip to content

Commit

Permalink
Properly handle server-side error for Pin request
Browse files Browse the repository at this point in the history
- eg. HTTP in range 5xx
  • Loading branch information
lidel committed Jan 1, 2016
1 parent 7f56a9f commit 5e1d2b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pin.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function pin(address) {
new Request({
url: uri.spec,
onComplete: function(response) {
let pinned = response.json.Pinned[0];
let pinned = response.json.Pinned ? response.json.Pinned[0] : false;
notifications.notify({
title: pinned ? 'Pinned' : 'Failed to pin',
text: pinned || address.slice(6)
Expand Down

0 comments on commit 5e1d2b7

Please sign in to comment.