Merge pull request #5110 from naturalcrit/fix-vault-crash

fix error crash with vault if server error
This commit is contained in:
Víctor Losada Hernández authored and GitHub committed 2026-10-13 14:13:57 +02:00
commit 70c4501e74
1 file changed
+11 -1
+11 -1
View File
@@ -74,7 +74,7 @@ const VaultPage = (props)=>{
updateStateWithBrews([], 1);
});
if(response.ok)
if(response?.ok)
updateStateWithBrews(response.body.brews, page);
};
@@ -364,6 +364,14 @@ const VaultPage = (props)=>{
}
if(error) {
if(error.HBErrorCode === undefined) {
return (
<div className='foundBrews noBrews'>
<h3>{error.toString()}</h3>
</div>
)
} else {
const errorText = ErrorIndex()[error.HBErrorCode.toString()] || '';
return (
@@ -373,6 +381,8 @@ const VaultPage = (props)=>{
);
}
}
if(!brewCollection) {
return (
<div className='foundBrews noBrews'>