🐛 Fixed #446 and crash on closing file picker for raw request body without selecting a file

This commit is contained in:
Liyas Thomas
2019-12-20 08:19:14 +05:30
parent 780bc55a96
commit 42e0200956

View File

@@ -224,12 +224,19 @@
<ul> <ul>
<li> <li>
<label for="rawBody">{{ $t("raw_request_body") }}</label> <label for="rawBody">{{ $t("raw_request_body") }}</label>
<textarea <Editor
id="rawBody"
@keydown="formatRawParams"
rows="8"
v-model="rawParams" v-model="rawParams"
></textarea> :lang="'json'"
@keydown="formatRawParams"
:options="{
maxLines: '16',
minLines: '8',
fontSize: '16px',
autoScrollEditorIntoView: true,
showPrintMargin: false,
useWorker: false
}"
/>
</li> </li>
</ul> </ul>
</div> </div>
@@ -2160,7 +2167,7 @@ export default {
uploadPayload() { uploadPayload() {
this.rawInput = true; this.rawInput = true;
let file = this.$refs.payload.files[0]; let file = this.$refs.payload.files[0];
if (file !== null) { if (file !== undefined && file !== null) {
let reader = new FileReader(); let reader = new FileReader();
reader.onload = e => { reader.onload = e => {
this.rawParams = e.target.result; this.rawParams = e.target.result;