From 573d42230a986671715a82c32567206349bf7b6b Mon Sep 17 00:00:00 2001 From: q4speed Date: Sun, 26 Apr 2020 10:33:12 +0800 Subject: [PATCH] fix null --- .../components/api/test/ApiTestConfig.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/frontend/src/business/components/api/test/ApiTestConfig.vue b/frontend/src/business/components/api/test/ApiTestConfig.vue index 618f72c38d..1a59732e68 100644 --- a/frontend/src/business/components/api/test/ApiTestConfig.vue +++ b/frontend/src/business/components/api/test/ApiTestConfig.vue @@ -75,15 +75,17 @@ }, getTest: function (id) { this.result = this.$get("/api/get/" + id, response => { - let item = response.data; + if (response.data) { + let item = response.data; - this.test = new Test({ - id: item.id, - projectId: item.projectId, - name: item.name, - scenarioDefinition: JSON.parse(item.scenarioDefinition), - }); - this.$refs.config.reset(); + this.test = new Test({ + id: item.id, + projectId: item.projectId, + name: item.name, + scenarioDefinition: JSON.parse(item.scenarioDefinition), + }); + this.$refs.config.reset(); + } }); }, saveTest: function () {