Skip to content

Commit e30c942

Browse files
committed
Added 'None' catch when determining context in the '_analyse' function of the Analyser class
1 parent 1fd74f2 commit e30c942

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

src/murfey/client/analyser.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -353,26 +353,28 @@ def _analyse(self):
353353
or transferred_file.name == "EpuSession.dm"
354354
and not self._context
355355
):
356-
if context := _get_context("SPAMetadataContext"):
357-
self._context = context.load()(
358-
"epu",
359-
self._basepath,
360-
self._murfey_config,
361-
self._token,
362-
)
356+
if not (context := _get_context("SPAMetadataContext")):
357+
continue
358+
self._context = context.load()(
359+
"epu",
360+
self._basepath,
361+
self._murfey_config,
362+
self._token,
363+
)
363364
elif (
364365
"Batch" in transferred_file.parts
365366
or "SearchMaps" in transferred_file.parts
366367
or transferred_file.name == "Session.dm"
367368
and not self._context
368369
):
369-
if context := _get_context("TomographyMetadataContext"):
370-
self._context = context.load()(
371-
"tomo",
372-
self._basepath,
373-
self._murfey_config,
374-
self._token,
375-
)
370+
if not (context := _get_context("TomographyMetadataContext")):
371+
continue
372+
self._context = context.load()(
373+
"tomo",
374+
self._basepath,
375+
self._murfey_config,
376+
self._token,
377+
)
376378
self.post_transfer(transferred_file)
377379
else:
378380
dc_metadata = {}

0 commit comments

Comments
 (0)