Skip to content

Commit

Permalink
Prevent crash when cancelling filechooser (#536)
Browse files Browse the repository at this point in the history
* Prevent attempt to get data when nothing has been selected. references #534

* 📝 Added logging

* 🔨 Add missing Logger import

* 📝 Added more loggin

* ♻️ Remove logging, prevent fetching data when cancelled

* Simplify doc string
  • Loading branch information
Zen-CODE committed Jan 30, 2020
1 parent d557d0c commit 0077d36
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions plyer/platforms/android/filechooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,8 @@ def _on_activity_result(self, request_code, result_code, data):
if request_code != self.select_code:
return

# bad response
if result_code != Activity.RESULT_OK:
print(
'Activity result failed',
result_code, data.getData().toString()
)
# The action had been cancelled.
return

selection = self._resolve_uri(data.getData()) or []
Expand Down

0 comments on commit 0077d36

Please sign in to comment.