tangled
alpha
login
or
join now
nekomimi.pet
/
wisp.place-monorepo
88
fork
atom
Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol.
wisp.place
88
fork
atom
overview
issues
10
pulls
pipelines
Handle empty tier metadata file
nekomimi.pet
2 weeks ago
45e5d79f
6e77c1a0
1/2
deploy-wisp.yml
success
38s
test.yml
failed
30s
+12
1 changed file
expand all
collapse all
unified
split
packages
@wispplace
tiered-storage
src
tiers
DiskStorageTier.ts
+12
packages/@wispplace/tiered-storage/src/tiers/DiskStorageTier.ts
···
208
208
readFile(metaPath, 'utf-8'),
209
209
]);
210
210
211
211
+
if (!metaContent.trim()) {
212
212
+
return null;
213
213
+
}
211
214
const metadata = JSON.parse(metaContent) as StorageMetadata;
212
215
213
216
// Convert date strings back to Date objects
···
221
224
} catch (error) {
222
225
const code = (error as NodeJS.ErrnoException).code;
223
226
if (code === 'ENOENT' || code === 'ENOTDIR') {
227
227
+
return null;
228
228
+
}
229
229
+
if (error instanceof SyntaxError) {
224
230
return null;
225
231
}
226
232
throw error;
···
244
250
try {
245
251
// Read metadata first to verify file exists
246
252
const metaContent = await readFile(metaPath, 'utf-8');
253
253
+
if (!metaContent.trim()) {
254
254
+
return null;
255
255
+
}
247
256
const metadata = JSON.parse(metaContent) as StorageMetadata;
248
257
249
258
// Convert date strings back to Date objects
···
260
269
} catch (error) {
261
270
const code = (error as NodeJS.ErrnoException).code;
262
271
if (code === 'ENOENT' || code === 'ENOTDIR') {
272
272
+
return null;
273
273
+
}
274
274
+
if (error instanceof SyntaxError) {
263
275
return null;
264
276
}
265
277
throw error;