mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Small reliability fixes
This commit is contained in:
parent
675fb6972a
commit
a26917b500
3 changed files with 13 additions and 6 deletions
|
@ -79,7 +79,7 @@ public class BrowserQuickAccessContextMenu extends ContextMenu {
|
|||
getItems().addAll(r.getItems());
|
||||
|
||||
// Prevent NPE in show()
|
||||
if (getScene() == null) {
|
||||
if (getScene() == null || anchor == null) {
|
||||
return;
|
||||
}
|
||||
show(anchor, Side.RIGHT, 0, 0);
|
||||
|
|
|
@ -113,6 +113,9 @@ public class AppTheme {
|
|||
}
|
||||
});
|
||||
});
|
||||
} catch (UnsupportedOperationException ex) {
|
||||
// The platform preferences are sometimes not initialized yet
|
||||
ErrorEvent.fromThrowable(ex).expected().omit().handle();
|
||||
} catch (Throwable t) {
|
||||
ErrorEvent.fromThrowable(t).omit().handle();
|
||||
}
|
||||
|
@ -136,6 +139,9 @@ public class AppTheme {
|
|||
} else {
|
||||
AppPrefs.get().theme.setValue(Theme.getDefaultLightTheme());
|
||||
}
|
||||
} catch (UnsupportedOperationException ex) {
|
||||
// The platform preferences are sometimes not initialized yet
|
||||
ErrorEvent.fromThrowable(ex).expected().omit().handle();
|
||||
} catch (Exception ex) {
|
||||
// The color scheme query can fail if the toolkit is not initialized properly
|
||||
AppPrefs.get().theme.setValue(Theme.getDefaultLightTheme());
|
||||
|
|
|
@ -15,14 +15,15 @@ public class AppUserDirectoryCheck {
|
|||
Files.createDirectories(dataDirectory);
|
||||
var testDirectory = dataDirectory.resolve("permissions_check");
|
||||
Files.createDirectories(testDirectory);
|
||||
if (!Files.exists(testDirectory)) {
|
||||
throw new IOException("Directory creation in user home directory failed silently");
|
||||
}
|
||||
Files.delete(testDirectory);
|
||||
// if (true) throw new IOException();
|
||||
} catch (IOException e) {
|
||||
ErrorEvent.fromThrowable(
|
||||
new IOException(
|
||||
"Unable to access directory " + dataDirectory
|
||||
+ ". Please make sure that you have the appropriate permissions and no Antivirus program is blocking the access. "
|
||||
+ "In case you use cloud storage, verify that your cloud storage is working and you are logged in."))
|
||||
ErrorEvent.fromThrowable("Unable to access directory " + dataDirectory
|
||||
+ ". Please make sure that you have the appropriate permissions and no Antivirus program is blocking the access. "
|
||||
+ "In case you use cloud storage, verify that your cloud storage is working and you are logged in.", e)
|
||||
.term()
|
||||
.expected()
|
||||
.handle();
|
||||
|
|
Loading…
Reference in a new issue