Skip to content
Permalink
Browse files

Use dynamic_cast instead of static_cast to downcast from a base to a …

…derived class
  • Loading branch information...
lauft committed Feb 26, 2019
1 parent 04adb50 commit 747d5606305040128c056dfc1c46ba8ce8f270a9
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Database.cpp
@@ -389,7 +389,7 @@ void Database::initializeTagDatabase ()
{
throw format ("Failed to find \"count\" member for tag \"{1}\" in tags database. Database corrupted?", key);
}
auto number = static_cast<json::number *> (iter->second);
auto number = dynamic_cast<json::number *> (iter->second);
_tagInfoDatabase.add (key, TagInfo {(unsigned int) number->_dvalue});
}
}

0 comments on commit 747d560

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.