Partial HTML implementation, partial GUI support
[fanfix.git] / src / be / nikiroo / fanfix / Library.java
index abe760b0d24e31862764093be7bdbcf0b670ce0d..15b81e44db7aca3caf8869f8f0b53539e1ddb8aa 100644 (file)
@@ -194,6 +194,11 @@ public class Library {
                        throw new IOException("Output type not supported: " + type);
                }
 
+               Story story = getStory(luid);
+               if (story == null) {
+                       throw new IOException("Cannot find story to export: " + luid);
+               }
+
                return out.process(getStory(luid), target);
        }
 
@@ -227,7 +232,9 @@ public class Library {
         *             in case of I/O error
         */
        private Story save(Story story, String luid) throws IOException {
+               // Do not change the original metadata, but change the original story
                MetaData key = story.getMeta().clone();
+               story.setMeta(key);
 
                if (luid == null || luid.isEmpty()) {
                        getStories(); // refresh lastId if needed