]> https://gitweb.dealii.org/ - dealii.git/commitdiff
do not throw exception in AnyData::try_read_ptr() even if different type 3102/head
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Sun, 11 Sep 2016 15:12:13 +0000 (17:12 +0200)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Sun, 11 Sep 2016 15:12:27 +0000 (17:12 +0200)
include/deal.II/algorithms/any_data.h

index 93ca7b2eda0aa23679a0a5a4cd601fca48105de6..05153daf1ee9be651b49836dd06f21d1f70b7045 100644 (file)
@@ -275,6 +275,8 @@ AnyData::try_read_ptr(const unsigned int i) const
   const type *const *p = boost::any_cast<type *>(&data[i]);
   if (p==0)
     p = boost::any_cast<const type *>(&data[i]);
+  if (p==0)
+    return 0;
   return *p;
 }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.