mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
Convert None to Void correctly
This commit is contained in:
parent
82c2728cfd
commit
08461d7b32
2 changed files with 8 additions and 0 deletions
|
@ -39,6 +39,10 @@ impl ToPyObject for PyValue {
|
|||
|
||||
impl FromPyObject<'_> for PyValue {
|
||||
fn extract(ob: &PyAny) -> PyResult<Self> {
|
||||
if ob.is_none() {
|
||||
return Ok(slint_interpreter::Value::Void.into());
|
||||
}
|
||||
|
||||
Ok(PyValue(
|
||||
ob.extract::<bool>()
|
||||
.map(|b| slint_interpreter::Value::Bool(b))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue