Skip to content

Commit

Permalink
fix: data is undefined when returned
Browse files Browse the repository at this point in the history
  • Loading branch information
NichArchA82 committed Oct 9, 2024
1 parent 839c39d commit 947bdd7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions command-handler/src/util/hetzner/hetzner-servers.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,15 @@ export default {

const userEmail = formatUser(info.user.profile.email);

if (!data) {
app.client.chat.postEphemeral({
channel: `${body.channel.id}`,
user: `${body.user.id}`,
text: `Failed to get server data from hetzner`
});
return [];
}

//list the servers and build the buttons
for (const server of data.data.servers) {
if (server.labels.owner === userEmail) {
Expand Down

0 comments on commit 947bdd7

Please sign in to comment.