Skip to content

Commit

Permalink
Return text response if communicator cannot be fetched for ClearGameD…
Browse files Browse the repository at this point in the history
…ataEndpoint.py
  • Loading branch information
Grennith committed Feb 21, 2024
1 parent 4ee0a2e commit 5d42036
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from mapadroid.madmin.endpoints.routes.control.AbstractControlEndpoint import \
AbstractControlEndpoint
from mapadroid.mapping_manager.MappingManager import DeviceMappingsEntry
from mapadroid.websocket.AbstractCommunicator import AbstractCommunicator


class ClearGameDataEndpoint(AbstractControlEndpoint):
Expand All @@ -29,6 +30,8 @@ async def get(self):
pass
# origin_logger.info('MADmin: ADB shell command successfully')
else:
temp_comm = self._get_ws_server().get_origin_communicator(origin)
temp_comm: Optional[AbstractCommunicator] = self._get_ws_server().get_origin_communicator(origin)
if not temp_comm:
return web.Response(text="Failed fetching connection to device.")
await temp_comm.reset_app_data("com.nianticlabs.pokemongo")
raise web.HTTPFound(self._url_for("get_phonescreens"))

0 comments on commit 5d42036

Please sign in to comment.