nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
93d0a89
)
lib/dom: avoid crash on empty tags data access
author
Alexandre Terrasa
<alexandre@moz-code.org>
Fri, 22 Sep 2017 20:36:23 +0000
(16:36 -0400)
committer
Alexandre Terrasa
<alexandre@moz-code.org>
Thu, 12 Oct 2017 00:49:00 +0000
(20:49 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
lib/dom/dom.nit
patch
|
blob
|
history
diff --git
a/lib/dom/dom.nit
b/lib/dom/dom.nit
index
5a1b8c0
..
0dfee06
100644
(file)
--- a/
lib/dom/dom.nit
+++ b/
lib/dom/dom.nit
@@
-58,13
+58,13
@@
redef class XMLStartTag
# var xml = code.to_xml
# assert xml["animal"].first["tiger"].first.as(XMLStartTag).data == "This is a white tiger!"
# ~~~
- fun data: String
+ fun data: nullable String
do
for child in children do
if child isa PCDATA then return child.content
if child isa CDATA then return child.content
end
- abort
+ return null
end
end