aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmldebug/qqmlprofilertypedevent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmldebug/qqmlprofilertypedevent.cpp')
-rw-r--r--src/qmldebug/qqmlprofilertypedevent.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qmldebug/qqmlprofilertypedevent.cpp b/src/qmldebug/qqmlprofilertypedevent.cpp
index 31a36bd052..94591ba7e3 100644
--- a/src/qmldebug/qqmlprofilertypedevent.cpp
+++ b/src/qmldebug/qqmlprofilertypedevent.cpp
@@ -58,9 +58,8 @@ QDataStream &operator>>(QDataStream &stream, QQmlProfilerTypedEvent &event)
RangeType rangeType = MaximumRangeType;
if (!stream.atEnd()) {
stream >> subtype;
- rangeType = static_cast<RangeType>(subtype);
- if (rangeType < 0 || rangeType > MaximumRangeType)
- rangeType = MaximumRangeType;
+ if (subtype >= 0 && subtype < MaximumRangeType)
+ rangeType = static_cast<RangeType>(subtype);
} else {
subtype = -1;
}