Skip to content

Commit

Permalink
Check for bad props in proplist
Browse files Browse the repository at this point in the history
  • Loading branch information
ra4nd0m committed Aug 27, 2024
1 parent 64d8ead commit b1ff63b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/pages/components/GetMaterialProps.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
onMount(async () => {
let payload = JSON.stringify({ material_source_id: `${mat_id}` });
let result = await doFetch(payload, "/getPropertyList", secret);
if (typeof result === "object" && "list" in result && result.list !== null) {
if (
typeof result === "object" &&
"list" in result &&
result.list !== null
) {
material_props_list = result.list as matProp[];
} else {
material_props_list = [];
Expand Down Expand Up @@ -45,11 +49,13 @@
</thead>
<tbody>
{#each material_props_list as row}
<tr>
<td>{row.Id}</td>
<td>{row.Name}</td>
<td>{row.Kind}</td>
</tr>
{#if row.Id <= 6 || import.meta.env.VITE_DEBUG === "true"}
<tr>
<td>{row.Id}</td>
<td>{row.Name}</td>
<td>{row.Kind}</td>
</tr>
{/if}
{/each}
<tr>
<td />
Expand Down

0 comments on commit b1ff63b

Please sign in to comment.