diff --git a/skel_common/readme_changelog.txt b/skel_common/readme_changelog.txt index 42f5420..3ea2f8a 100644 --- a/skel_common/readme_changelog.txt +++ b/skel_common/readme_changelog.txt @@ -2,6 +2,7 @@ Changelog ???: - Added "Return FTL to an unmodded state before switching to a new version" +- Fixed advanced find tags' panic arg (was "true" all the time) - Fixed perpetually green "Update" button 1.2: diff --git a/src/main/java/net/vhati/modmanager/core/XMLPatcher.java b/src/main/java/net/vhati/modmanager/core/XMLPatcher.java index 4737f7f..14673e7 100644 --- a/src/main/java/net/vhati/modmanager/core/XMLPatcher.java +++ b/src/main/java/net/vhati/modmanager/core/XMLPatcher.java @@ -124,7 +124,7 @@ public class XMLPatcher { matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() ); } } - if ( matchedNodes.isEmpty() ) + if ( panic && matchedNodes.isEmpty() ) throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) ); result = matchedNodes; @@ -175,7 +175,7 @@ public class XMLPatcher { matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() ); } } - if ( matchedNodes.isEmpty() ) + if ( panic && matchedNodes.isEmpty() ) throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) ); result = matchedNodes; @@ -226,7 +226,7 @@ public class XMLPatcher { matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() ); } } - if ( matchedNodes.isEmpty() ) + if ( panic && matchedNodes.isEmpty() ) throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) ); result = matchedNodes; @@ -257,7 +257,7 @@ public class XMLPatcher { matchedNodes = matchedNodes.subList( searchStart, matchedNodes.size() ); } } - if ( matchedNodes.isEmpty() ) + if ( panic && matchedNodes.isEmpty() ) throw new NoSuchElementException( String.format( "<%s> was set to require results but found none (%s).", node.getName(), getPathToRoot(node) ) ); result = matchedNodes;