Skip to content

Commit c384fdf

Browse files
authored
Merge pull request #10 from dannyhp1/develop
Added check before uploading paste.
2 parents e233644 + 17ba786 commit c384fdf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/Editor.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ class Editor extends Component {
5656
}
5757

5858
uploadPaste = () => {
59+
if(this.state.text === ``) {
60+
alert('You cannot upload an empty paste.')
61+
return
62+
}
63+
5964
// TODO: Add options for author and for code highlighting.
6065
this.setInProgress()
6166

0 commit comments

Comments
 (0)