From 21fa1a19c419af2e32f4dd6738e7311654777aac Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 24 Nov 2012 06:27:24 +0000 Subject: [PATCH] * don't crash just because if there's something wrong with GVFS --- .../filebot/ui/transfer/FileTransferable.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/net/sourceforge/filebot/ui/transfer/FileTransferable.java b/source/net/sourceforge/filebot/ui/transfer/FileTransferable.java index c3f4551f..c27ca54f 100644 --- a/source/net/sourceforge/filebot/ui/transfer/FileTransferable.java +++ b/source/net/sourceforge/filebot/ui/transfer/FileTransferable.java @@ -122,19 +122,23 @@ public class FileTransferable implements Transferable { file = new File(uri); } catch (IllegalArgumentException e) { // try handle other GVFS URI schemes - if (GVFS.isSupported()) { - file = GVFS.getPathForURI(uri); + try { + if (GVFS.isSupported()) { + file = GVFS.getPathForURI(uri); + } + } catch (LinkageError error) { + Logger.getLogger(FileTransferable.class.getName()).log(Level.WARNING, "Unable to resolve GVFS URI", e); } } - if (!file.exists()) { - throw new FileNotFoundException(file.toString()); + if (file == null || !file.exists()) { + throw new FileNotFoundException(line); } files.add(file); } catch (Throwable e) { // URISyntaxException, IllegalArgumentException, FileNotFoundException, LinkageError, etc - Logger.getLogger(FileTransferable.class.getName()).log(Level.WARNING, "Invalid file URI: " + line, e); + Logger.getLogger(FileTransferable.class.getName()).log(Level.WARNING, "Invalid file URI: " + line); } return files; }