nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4866675
)
nitmetrics: dont crash if nclassdef.mclassdef is null
author
Jean Privat
<jean@pryen.org>
Thu, 3 Aug 2017 13:20:18 +0000
(09:20 -0400)
committer
Jean Privat
<jean@pryen.org>
Thu, 3 Aug 2017 13:20:18 +0000
(09:20 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>
src/metrics/static_types_metrics.nit
patch
|
blob
|
history
diff --git
a/src/metrics/static_types_metrics.nit
b/src/metrics/static_types_metrics.nit
index
5276632
..
45c429b
100644
(file)
--- a/
src/metrics/static_types_metrics.nit
+++ b/
src/metrics/static_types_metrics.nit
@@
-53,8
+53,9
@@
private class ATypeCounterVisitor
do
if n isa AAnnotation then return
- if n isa AType then
- var mclassdef = self.nclassdef.mclassdef.as(not null)
+ if n isa AType then do
+ var mclassdef = self.nclassdef.mclassdef
+ if mclassdef == null then break
var mtype = modelbuilder.resolve_mtype(mclassdef, n)
if mtype != null then
self.typecount.inc(mtype)