Changeset 10090


Ignore:
Timestamp:
04/06/11 05:52:00 (9 years ago)
Author:
anthony43
Message:

added a null check , since I encountered the case when there can be no image tag in an image element

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/transverse/util/Tools.java

    r9919 r10090  
    351351    public static String getStringValueDom(Element element, String tagName) { 
    352352        Element el = (Element) element.getElementsByTagName(tagName).item(0); 
    353         return el.getFirstChild().getNodeValue(); 
     353        if (el != null) { 
     354                return el.getFirstChild().getNodeValue(); 
     355        } 
     356        // if not, empty string is safer then null 
     357        return ""; 
    354358    } 
    355359 
Note: See TracChangeset for help on using the changeset viewer.