Mike,

how about cleanly testing if XMLTools.simpleXPath() returns Null and if it is 
empty etc. ? the below approach masks all errors that might appear and does not 
even print a stack!

if you give me a service url to test against i might have a look.

..ede

On 13.01.2020 21:36, jump-pilot-svn--- via Jump-pilot-devel wrote:
> Revision: 6222
>           http://sourceforge.net/p/jump-pilot/code/6222
> Author:   michaudm
> Date:     2020-01-13 20:36:59 +0000 (Mon, 13 Jan 2020)
> Log Message:
> -----------
> Try to fix #491 (cannot read title in getCapability)
>
> Modified Paths:
> --------------
>     core/trunk/src/com/vividsolutions/wms/Parser.java
>
> Modified: core/trunk/src/com/vividsolutions/wms/Parser.java
> ===================================================================
> --- core/trunk/src/com/vividsolutions/wms/Parser.java 2020-01-13 15:59:05 UTC 
> (rev 6221)
> +++ core/trunk/src/com/vividsolutions/wms/Parser.java 2020-01-13 20:36:59 UTC 
> (rev 6222)
> @@ -366,7 +366,7 @@
>        // get the title
>        try {
>          title = ((CharacterData)XMLTools.simpleXPath( doc, 
> "WMT_MS_Capabilities/Service/Title" ).getFirstChild()).getData();
> -      } catch (NullPointerException e) {
> +      } catch (Exception e) {
>          title = "not available";
>        }
>
>
>
>
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>



_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to