Commit c1cbd441 authored by Robert McGibbon's avatar Robert McGibbon
Browse files

range check getPlatform()

parent 2bf08a95
......@@ -134,7 +134,10 @@ int Platform::getNumPlatforms() {
}
Platform& Platform::getPlatform(int index) {
return *getPlatforms()[index];
if (index >= 0 && index < getNumPlatforms()) {
return *getPlatforms()[index];
}
throw OpenMMException("Invalid platform index");
}
Platform& Platform::getPlatformByName(const string& name) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment