fix: read properties of null in NodeSelector

This commit is contained in:
0xJacky 2023-12-15 22:38:56 +08:00
parent 53e1c32444
commit 591486a689
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
2 changed files with 4 additions and 4 deletions

View file

@ -148,7 +148,7 @@ func GetDomain(c *gin.Context) {
certInfoMap := make(map[int]*cert.Info)
for serverIdx, server := range nginxConfig.Servers {
for serverIdx, server := range nginxConfig.Servers {
for _, directive := range server.Directives {
if directive.Directive == "ssl_certificate" {
@ -229,7 +229,7 @@ func SaveDomain(c *gin.Context) {
})
return
}
// recreate soft link
// recreate a soft link
if helper.FileExists(enabledConfigFilePath) {
_ = os.Remove(enabledConfigFilePath)
enabledConfigFilePath = nginx.GetConfPath("sites-enabled", json.Name)

View file

@ -19,7 +19,7 @@ const data_map = ref({}) as Ref<Record<number, Environment>>
environment.get_list().then(r => {
data.value = r.data
r.data.forEach(node => {
r.data?.forEach(node => {
data_map.value[node.id] = node
})
})
@ -79,7 +79,7 @@ const value = computed({
</ATag>
</ACol>
</ARow>
<AEmpty v-if="hiddenLocal && data.length === 0" />
<AEmpty v-if="hiddenLocal && data?.length === 0" />
</ACheckboxGroup>
</template>