Skip to content

Commit 591486a

Browse files
committed
fix: read properties of null in NodeSelector
1 parent 53e1c32 commit 591486a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

api/sites/domain.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func GetDomain(c *gin.Context) {
148148

149149
certInfoMap := make(map[int]*cert.Info)
150150

151-
for serverIdx, server := range nginxConfig.Servers {
151+
for serverIdx, server := range nginxConfig.Servers {
152152
for _, directive := range server.Directives {
153153
if directive.Directive == "ssl_certificate" {
154154

@@ -229,7 +229,7 @@ func SaveDomain(c *gin.Context) {
229229
})
230230
return
231231
}
232-
// recreate soft link
232+
// recreate a soft link
233233
if helper.FileExists(enabledConfigFilePath) {
234234
_ = os.Remove(enabledConfigFilePath)
235235
enabledConfigFilePath = nginx.GetConfPath("sites-enabled", json.Name)

app/src/components/NodeSelector/NodeSelector.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const data_map = ref({}) as Ref<Record<number, Environment>>
1919
2020
environment.get_list().then(r => {
2121
data.value = r.data
22-
r.data.forEach(node => {
22+
r.data?.forEach(node => {
2323
data_map.value[node.id] = node
2424
})
2525
})
@@ -79,7 +79,7 @@ const value = computed({
7979
</ATag>
8080
</ACol>
8181
</ARow>
82-
<AEmpty v-if="hiddenLocal && data.length === 0" />
82+
<AEmpty v-if="hiddenLocal && data?.length === 0" />
8383
</ACheckboxGroup>
8484
</template>
8585

0 commit comments

Comments
 (0)