@@ -181,47 +181,50 @@ public void populateObject(Element element)
181181 // the metadata element
182182 Element mdElement = element .getChild ("md" , ResourceSync .NS_RS );
183183
184- // - capability
185- String capability = mdElement .getAttributeValue ("capability" , ResourceSync .NS_RS );
186- if (capability != null && !"" .equals (capability ))
184+ if (mdElement != null )
187185 {
188- this .setCapability (capability );
189- }
186+ // - capability
187+ String capability = mdElement .getAttributeValue ("capability" , ResourceSync .NS_RS );
188+ if (capability != null && !"" .equals (capability ))
189+ {
190+ this .setCapability (capability );
191+ }
190192
191- // - change
192- String change = mdElement .getAttributeValue ("change" , ResourceSync .NS_RS );
193- if (change != null && !"" .equals (change ))
194- {
195- this .setChange (change );
196- }
193+ // - change
194+ String change = mdElement .getAttributeValue ("change" , ResourceSync .NS_RS );
195+ if (change != null && !"" .equals (change ))
196+ {
197+ this .setChange (change );
198+ }
197199
198- // - hash
199- String hashAttr = mdElement .getAttributeValue ("hash" , ResourceSync .NS_ATOM );
200- if (hashAttr != null && !"" .equals (hashAttr ))
201- {
202- this .addHashesFromAttr (hashAttr );
203- }
200+ // - hash
201+ String hashAttr = mdElement .getAttributeValue ("hash" , ResourceSync .NS_ATOM );
202+ if (hashAttr != null && !"" .equals (hashAttr ))
203+ {
204+ this .addHashesFromAttr (hashAttr );
205+ }
204206
205- // - length
206- String length = mdElement .getAttributeValue ("length" , ResourceSync .NS_ATOM );
207- if (length != null && !"" .equals (length ))
208- {
209- long l = Long .parseLong (length );
210- this .setLength (l );
211- }
207+ // - length
208+ String length = mdElement .getAttributeValue ("length" , ResourceSync .NS_ATOM );
209+ if (length != null && !"" .equals (length ))
210+ {
211+ long l = Long .parseLong (length );
212+ this .setLength (l );
213+ }
212214
213- // - path
214- String path = mdElement .getAttributeValue ("path" , ResourceSync .NS_RS );
215- if (path != null && !"" .equals (path ))
216- {
217- this .setPath (path );
218- }
215+ // - path
216+ String path = mdElement .getAttributeValue ("path" , ResourceSync .NS_RS );
217+ if (path != null && !"" .equals (path ))
218+ {
219+ this .setPath (path );
220+ }
219221
220- // - type
221- String type = mdElement .getAttributeValue ("type" , ResourceSync .NS_ATOM );
222- if (type != null && !"" .equals (type ))
223- {
224- this .setType (type );
222+ // - type
223+ String type = mdElement .getAttributeValue ("type" , ResourceSync .NS_ATOM );
224+ if (type != null && !"" .equals (type ))
225+ {
226+ this .setType (type );
227+ }
225228 }
226229
227230 // all the rs:ln elements
0 commit comments